Problem with order sending with my EA

 

I am using ATR TRAILER EA, but there is a problem in ordersend() its not doing trading but when I am testing it using strategy tester its giving me right result. please help me regarding this. I am attaching my code file with this . please find attachment.

Thanks in Advance.

Files:
atrcea.txt  5 kb
 

What errors do you have in the Experts tab ?

Is your Broker an ECN Broker ?

 
StopLevel = MarketInfo(Symbol(), MODE_STOPLEVEL) + MarketInfo(Symbol(), MODE_SPREAD);
:
double SL = Bid - ATR;//NormalizeDouble(Bid - ATR, Digits);
if (SL < StopLevel) SL = StopLevel;
int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, 100, SL,0, "ATR-Trader", Magic,0,Blue); 
  
  1. stop level is a number like 30 (points,) spread is like 2. SL is a price like 1.4567. What does if(1.4567 < 32) mean?
  2. On ECN brokers you must open first and then set stops.
  3. You tested the return code. What is the error number?