beginner mql4 programmer
in this community to get help learning more and help when i can (i can by learning more!)
Друзья 3
buildmt4ea
buildmt4ea
this code won't place any orders as an expert advisor in the mt4 strategy tester and it's returning the following error in the journal, i don't know what the problem can be, can someone help?
error: "TestGenerator: unmatched data error (volume limit 2431 at 2023.01.26 13:00 exceeded)"

code:

bool isDowntrend21MA()
{
if (iMA(NULL,NULL,21,0,MODE_SMA,PRICE_CLOSE,0) < iMA(NULL,NULL,21,0,MODE_SMA,PRICE_CLOSE,10))
return true;
else return false;
}

bool isUptrend21MA()
{
if (iMA(NULL,NULL,21,0,MODE_SMA,PRICE_CLOSE,0) > iMA(NULL,NULL,21,0,MODE_SMA,PRICE_CLOSE,10))
return true;
else return false;
}


void OnTick()
{
if(Bid==iMA(NULL,NULL,200,0,MODE_SMMA,PRICE_CLOSE,0) &&
iClose(NULL,NULL,2) isUptrend21MA())
{int ticketbuy1 = OrderSend(NULL,OP_BUY,0.1,Ask,1,Bid-0.0005,Ask+0.0005,NULL,0,0,clrLimeGreen);}

if(Bid==iMA(NULL,NULL,200,0,MODE_SMMA,PRICE_CLOSE,0) &&
iClose(NULL,NULL,2)>iMA(NULL,NULL,200,0,MODE_SMMA,PRICE_CLOSE,0) &&
isDowntrend21MA())
{int ticketsell1 = OrderSend(NULL,OP_SELL,0.1,Bid,1,Ask+0.0005,Bid-0.0005,NULL,0,0,clrRed);}
}
buildmt4ea
buildmt4ea 2023.02.02
probably not a good strategy so i don't suggest anyone uses it even if it seems to work in the strategy tester after any problems have been solved. just trying to learn mql4
buildmt4ea
Зарегистрировался в MQL5.community