Forex



Go Back   Forex Trading > Programming > Metatrader Programming






Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #1001 (permalink)  
Old 06-10-2008, 10:09 AM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
This backtesting, did it gave buys and sells or only one of them? With me i got only buys (or only sells when I changed the code).
I realy have seen nothing that shows an error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1002 (permalink)  
Old 06-10-2008, 10:15 AM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
I'm doing a backtest now only with the RSIFilter, I do use the RSIMixFilter few posts ago in this thread, I published that indicator, and I do get BUYS and SELLS, so the logic to do the orders BUY and SELL are ok, the issue is with your iCustom signals...
So this is ok?

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);

if ( Sg>0) Order = SIGNAL_BUY;
if (Sg<0 ) Order = SIGNAL_SELL;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1003 (permalink)  
Old 06-10-2008, 10:17 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 642
Blog Entries: 1
IN10TION is on a distinguished road
I had buys and sells.

Quote:
Originally Posted by panteraschoice View Post
This backtesting, did it gave buys and sells or only one of them? With me i got only buys (or only sells when I changed the code).
I realy have seen nothing that shows an error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1004 (permalink)  
Old 06-10-2008, 10:21 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 642
Blog Entries: 1
IN10TION is on a distinguished road
this RSIFilter_v1... I don't know about that...
the code you show here has to do it...
Here is what I did... see attachments.

Quote:
Originally Posted by panteraschoice View Post
So this is ok?

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);

if ( Sg>0) Order = SIGNAL_BUY;
if (Sg<0 ) Order = SIGNAL_SELL;
Attached Files
File Type: mq4 ! IN10TION RSIMix test EA.mq4 (7.5 KB, 34 views)
File Type: mq4 RSIMixFilter_v1.mq4 (3.6 KB, 29 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1005 (permalink)  
Old 06-10-2008, 11:09 AM
Senior Member
 
Join Date: Feb 2007
Posts: 985
FerruFx is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
Has to be 90% modelling quality, don't know why it doesn't show.
I think it's due to the mismatched errors. Backtester since few releases has this problem. Heard that it's because of bad datas.

FerruFx
__________________
FerruFx / www.ervent.net - Professional Coding Services (EAs/Indicators/Alerts)

BBVPS.com - Reliable Windows VPS For MT4 Hosting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1006 (permalink)  
Old 06-10-2008, 01:39 PM
Member
 
Join Date: May 2008
Posts: 31
payback is on a distinguished road
Unhappy boolean match error

Hi all, i have this error and i don't understand how to figure out, i think it's a problem of matching different types of variables

here is the snippet of the code


double
BuyCondition,
SellCondition,
StopLong,
StopSell;

the indicators are

double indicator1,
indicator2
indicator 3; (but is int)

so i want those conditions
PHP Code:
StopLong  = ((SellValueCurrent !=&& SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE));
   
StopSell  = ((BuyValueCurrent !=&& BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)); 
so why sometimes i don't have 0 when i need 1 and sometimes i have both1 when or one of them should bhe 1? this now for me make no sense at all why is wrong? please help me!!!


p.s. sellvalue and buyvalue are double
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1007 (permalink)  
Old 06-10-2008, 01:50 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 642
Blog Entries: 1
IN10TION is on a distinguished road
need more code to fix this...
if you wish, publish your mq4

Quote:
Originally Posted by payback View Post
Hi all, i have this error and i don't understand how to figure out, i think it's a problem of matching different types of variables

here is the snippet of the code


double
BuyCondition,
SellCondition,
StopLong,
StopSell;

the indicators are

double indicator1,
indicator2
indicator 3; (but is int)

so i want those conditions
PHP Code:
StopLong  = ((SellValueCurrent !=&& SellValueCurrent2 !=0) || (TrendEnvDown != EMPTY_VALUE));
   
StopSell  = ((BuyValueCurrent !=&& BuyValueCurrent2 !=0) || (TrendEnvUp != EMPTY_VALUE)); 
so why sometimes i don't have 0 when i need 1 and sometimes i have both1 when or one of them should bhe 1? this now for me make no sense at all why is wrong? please help me!!!


p.s. sellvalue and buyvalue are double
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1008 (permalink)  
Old 06-10-2008, 02:05 PM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
OrderClose error

Something goes wrong. The demo account was wiped out completely.

Here is a small part from the expert log, with hundreds of those "invalid price for OrderClose function" :

GBPJPY at 209.23 sl: 212.23 tp: 208.23 ok
10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: invalid price 2.02750000
for OrderClose function
10:00:04 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55750000
for OrderClose function
10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: close #11685361 sell
0.10 GBPCHF at 2.0270 sl: 2.0570 tp: 2.0170 at price 2.0275
10:00:05 2730_BasketVentilatorVoorProg_2 USDCHF,H1: invalid price 1.03350000
for OrderClose function
10:00:05 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55740000
for OrderClose function

this is the part in the ea for the OrderClose,
I do not see what is wrong in it, maybe someone can help?

//---------------------
int l_ord_total_72 = OrdersTotal();
for (int l_pos_76 = 0; l_pos_76 < l_ord_total_72; l_pos_76++) {
if (OrderSelect(l_pos_76, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol()) {
l_cmd_80 = OrderType();
if (l_cmd_80 == OP_BUY) {
l_count_56++;
if (l_isar_48 > Close[0]) OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
}
if (l_cmd_80 == OP_SELL) {
l_count_60++;
if (l_isar_48 < Close[0]) OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
}
}
}
}
//--------------------

Compiling does not give an error.

Last edited by panteraschoice; 06-10-2008 at 02:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1009 (permalink)  
Old 06-10-2008, 02:09 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 718
Kalenzo is on a distinguished road
Quote:
Originally Posted by panteraschoice View Post
Something goes wrong. The demo account was wiped out completely.

Here is a small part from the expert log, with hundreds of those "invalid price for OrderClose function" :

GBPJPY at 209.23 sl: 212.23 tp: 208.23 ok
10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: invalid price 2.02750000
for OrderClose function
10:00:04 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55750000
for OrderClose function
10:00:04 2730_BasketVentilatorVoorProg_2 GBPCHF,H1: close #11685361 sell
0.10 GBPCHF at 2.0270 sl: 2.0570 tp: 2.0170 at price 2.0275
10:00:05 2730_BasketVentilatorVoorProg_2 USDCHF,H1: invalid price 1.03350000
for OrderClose function
10:00:05 2730_BasketVentilatorVoorProg_2 EURUSD,H1: invalid price 1.55740000
for OrderClose function

this is the part in the ea for the OrderClose,
I do not see what is wrong in it, maybe someone can help?

//---------------------
int l_ord_total_72 = OrdersTotal();
for (int l_pos_76 = 0; l_pos_76 < l_ord_total_72; l_pos_76++) {
if (OrderSelect(l_pos_76, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol()) {
l_cmd_80 = OrderType();
if (l_cmd_80 == OP_BUY) {
l_count_56++;
if (l_isar_48 > Close[0]) OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
}
if (l_cmd_80 == OP_SELL) {
l_count_60++;
if (l_isar_48 < Close[0]) OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
}
}
}
}
//--------------------
Maybe you got new prices from broker, try to use RefreshRates function before OrderClose if you will get error.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1010 (permalink)  
Old 06-10-2008, 02:48 PM
Member
 
Join Date: May 2008
Posts: 31
payback is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
need more code to fix this...
if you wish, publish your mq4
no i don't want to publish all but i think is a problem with the types match of variables i'll try to explain more

indicator1 e 2 are double right

so i have buyvaluecurrent = icustom(indicator1 etc etc);
buyvaluecurrent2 = icustom(indicator2 etc etc);
sellvaluecurrent = icustom(indicator1 etc etc); //doubles right?
trenendvup =icustom (indicator3 etc etc) ; //int
and so on

so buycondition= ((buyvaluecurrent !=0 && buyvaluecurrent2 !=0) && (trendenvup != Empty_Value);

this statment works only sometimes and also could be a problem, so my question is why? i want that buycondition returns 1 or 0 no matter of what type is bool or double
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 02:42 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.