my EA closes my order one bar after

 

Hi,

I'm testing my EA on the strategy tester.

If I place a sell order, and the current bar reverses immediately, then my stoploss is triggered on the next bar,even if my stoploss is 100000. 

My code is : OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*Point,Bid-TakeProfit*Point,"sample",MathRand(),0,Red);

Anyone run into a similar scenario ?

 

 

 
genfron:

Hi,

I'm testing my EA on the strategy tester.

If I place a sell order, and the current bar reverses immediately, then my stoploss is triggered on the next bar,even if my stoploss is 100000. 

My code is : OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*Point,Bid-TakeProfit*Point,"sample",MathRand(),0,Red);


Your SL can be triggered on the same bar let alone the next bar . . .  but only if the Ask price hits your SL price . . .
 

So you are saying my SL is not big enough.

 Ok thx

 
genfron:

So you are saying my SL is not big enough.

 Ok thx

Where you have your SL is up to you . . .  for a Sell if Ask hits your SL your order will be closed.
Reason: