Hi,
A little help here! please!
My ea works fine on currencies but have problem with WTI.
It just repeat error 131 in backtesting with no obvious reasons!
void DoOpenOrders(int orderType,double price)
{
//-------------
if(!AllowEAOpenOrders) return(0);
if(GetOrdersTotal(orderType)>0) return(0);
if(!IsTradeAllowed()) return(0);
//int SLpoint=k_SL*ATR;
double lots=GetLots();
string orderComment=DoubleToStr(lots,GetL());//用于平半仓 =GetLots()
//if(orderType==OP_BUY) price=Ask;
//else if(orderType==OP_SELL) price=Bid;
//---------
int ticket=OrderSend(Symbol(),orderType,lots,NormalizeDouble(price,Digits),Slippage,0,0,"",MagicNum,0,Gold);
if(ticket>0)
{
Print("EA Open Order Succeed."+Symbol()+" M"+Period());
}
else Print("Error opening order Err: ",GetLastError());
}
EA attached
A little help here! please!
My ea works fine on currencies but have problem with WTI.
It just repeat error 131 in backtesting with no obvious reasons!
void DoOpenOrders(int orderType,double price)
{
//-------------
if(!AllowEAOpenOrders) return(0);
if(GetOrdersTotal(orderType)>0) return(0);
if(!IsTradeAllowed()) return(0);
//int SLpoint=k_SL*ATR;
double lots=GetLots();
string orderComment=DoubleToStr(lots,GetL());//用于平半仓 =GetLots()
//if(orderType==OP_BUY) price=Ask;
//else if(orderType==OP_SELL) price=Bid;
//---------
int ticket=OrderSend(Symbol(),orderType,lots,NormalizeDouble(price,Digits),Slippage,0,0,"",MagicNum,0,Gold);
if(ticket>0)
{
Print("EA Open Order Succeed."+Symbol()+" M"+Period());
}
else Print("Error opening order Err: ",GetLastError());
}
EA attached
Attached Image
Attached File(s)
+Cyborg M5 BUY Saver.mq4
112 KB
|
594 downloads
No one wants to be defeated~