I need a HELP !!!

 

Dears,

Please i need help to know why my EA not work however its work in Strarty tester and gain a points,

and im sure Metatrade optiion as the smil face its apper to me

Pleae I need your Advice

And the below my test EA :

#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net//"

extern int Step = 200;
extern int Vol = 100;
extern double TakeProfit = 50;
extern double Stoploss = 50;
extern double Lots = 3;
extern int MAGICMA = 261184;

//+------------------------------------------------------------------+
//| Start function |
//+------------------------------------------------------------------+

void start()
{
double M1,M2,M3;

M1=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0);
M2=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
M3=iMA(NULL,0,50,0,MODE_SMA,PRICE_CLOSE,0);

if(Bars<10 || IsTradeAllowed()==false) return;
{
if(OrdersTotal()==0)
{
//---- buy conditions
{if(M2>M3 && M1>M2)
OrderSend(Symbol(),OP_BUY,Lots*0.01,Ask,0,/*Bid-Stoploss*Point*/0,Ask+TakeProfit*Point,"EA",MAGICMA,0,Green);
}
//---- sell conditions
{if(M2>M1 && M3>M2)
OrderSend(Symbol(),OP_SELL,Lots*0.01,Bid,0,/*Ask+Stoploss*Point*/0,Bid-TakeProfit*Point,"EA",MAGICMA,0,Red);
}
}
}
//+------------------------------------------------------------------+

 

S

Are there any errors listed in the Journal or Experts tab of the Terminal?

-BB-

 
BarrowBoy:

S

Are there any errors listed in the Journal or Experts tab of the Terminal?

-BB-


Noooo, Just nonthing :(

i need to know why its work in Strategy tester and not work in live trade

 

try & c what error u get

//---- buy conditions
{if(M2>M3 && M1>M2)
OrderSend(Symbol(),OP_BUY,Lots*0.01,Ask,0,/*Bid-Stoploss*Point*/0,Ask+TakeProfit*Point,"EA",MAGICMA,0,Green);
   Alert("OrderSend() error - ", GetLastError());
   }
//---- sell conditions
{if(M2>M1 && M3>M2)
OrderSend(Symbol(),OP_SELL,Lots*0.01,Bid,0,/*Ask+Stoploss*Point*/0,Bid-TakeProfit*Point,"EA",MAGICMA,0,Red);
   Alert("OrderSend() error - ", GetLastError());

if it's 130

int dig = 1;

if (Digits == 5 || Digits == 3)
  dig = 10;   

int ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,3*dig,0,0,NULL,1234,0,Blue);
if (ticket > -1)
   {
   OrderSelect(ticket, SELECT_BY_TICKET);
   bool retrn = OrderModify(OrderTicket(), OrderOpenPrice(), Bid-15*Point*dig, Bid+15*Point*dig, 0, Blue);
   if (retrn == false)
   Alert("OrderModify() error - ", (GetLastError()));
   }
else
   {
   Alert("OrderSend() error - ", (GetLastError()));
   }

 

You can try this...

#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

extern int Step = 200;
extern int Vol = 100;
extern double TakeProfit = 50;
extern double StopLoss = 50;
extern double Lots = 3;
extern int MAGICMA = 261184;

//+------------------------------------------------------------------+
//| Start function |
//+------------------------------------------------------------------+

void start()
{
double M1,M2,M3;
double TP,SL,Mul;
int Ticket;

M1=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0);
M2=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
M3=iMA(NULL,0,50,0,MODE_SMA,PRICE_CLOSE,0);

if(Bars<10 || IsTradeAllowed()==false) return;
{
if(OrdersTotal()==0)
{
if(Digits==3 || Digits==5) Mul=10;
if(Digits==2 || Digits==4) Mul=1;
//---- buy conditions
if(M2>M3 && M1>M2)
{
TP=Ask+(TakeProfit*Mul)*Point;
SL=Ask-(StopLoss*Mul)*Point;
Ticket=OrderSend(Symbol(),OP_BUY,Lots*0.01,Ask,0,0.0,0.0,"EA",MAGICMA,0,Green);
if(Ticket>0)
{
OrderModify(Ticket,OrderOpenPrice(),SL,TP,0,Green);
}
else
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
}
//---- sell conditions
if(M2>M1 && M3>M2)
{
TP=Bid-(TakeProfit*Mul)*Point;
SL=Bid+(StopLoss*Mul)*Point;
Ticket=OrderSend(Symbol(),OP_SELL,Lots*0.01,Bid,0,0.0,0.0,"EA",MAGICMA,0,Red);
if(Ticket>0)
{
OrderModify(Ticket,OrderOpenPrice(),SL,TP,0,Green);
}
else
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
}
}
}
}
//+------------------------------------------------------------------+

 

For code. please use the SRC button. Thanks

 
qjol:

try & c what error u get

if it's 130




Thanks, I will test that and feed you back,


But if the reason of not working its digits why it work at strategy and didn't work in Live trade

 
Arwee:

You can try this...

#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

extern int Step = 200;
extern int Vol = 100;
extern double TakeProfit = 50;
extern double StopLoss = 50;
extern double Lots = 3;
extern int MAGICMA = 261184;

//+------------------------------------------------------------------+
//| Start function |
//+------------------------------------------------------------------+

void start()
{
double M1,M2,M3;
double TP,SL,Mul;
int Ticket;

M1=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0);
M2=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
M3=iMA(NULL,0,50,0,MODE_SMA,PRICE_CLOSE,0);

if(Bars<10 || IsTradeAllowed()==false) return;
{
if(OrdersTotal()==0)
{
if(Digits==3 || Digits==5) Mul=10;
if(Digits==2 || Digits==4) Mul=1;
//---- buy conditions
if(M2>M3 && M1>M2)
{
TP=Ask+(TakeProfit*Mul)*Point;
SL=Ask-(StopLoss*Mul)*Point;
Ticket=OrderSend(Symbol(),OP_BUY,Lots*0.01,Ask,0,0.0,0.0,"EA",MAGICMA,0,Green);
if(Ticket>0)
{
OrderModify(Ticket,OrderOpenPrice(),SL,TP,0,Green);
}
else
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
}
//---- sell conditions
if(M2>M1 && M3>M2)
{
TP=Bid-(TakeProfit*Mul)*Point;
SL=Bid+(StopLoss*Mul)*Point;
Ticket=OrderSend(Symbol(),OP_SELL,Lots*0.01,Bid,0,0.0,0.0,"EA",MAGICMA,0,Red);
if(Ticket>0)
{
OrderModify(Ticket,OrderOpenPrice(),SL,TP,0,Green);
}
else
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
}
}
}
}
//+------------------------------------------------------------------+


Thanks, i think the digit its reason of that

I will test that and feed you back,


But the same question if the reason of not working its digits why it work at strategy and didn't work in Live trade ?

 
enotrek:

For code. please use the SRC button. Thanks


thanks for helping me but i need to know what is the SRC Button ?
 
semotallica:

thanks for helping me but i need to know what is the SRC Button ?