double TrueRange = 1.5 * ATR(24)[0];
// Stop Loss Long
if (Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) < -TrueRange
&& Position.MarketPosition == MarketPosition.Long)
ExitLong("LongStopLoss", "Long");
In the backtest it was fine, but when I started to trade it live it created a lot of orders inside the same bar (30min).
I don't understand why it happened, since the ATR was worth about 37 pips (less than the whole range of the bar where the trades took place), and the spread was tight (2 pips).
1) Any suggestion why it happened?
2) I guess I better switch to SetStopLoss() method. Is there any advantage in comparison to what I coded above?
3) With the SetStopLoss() method, would it be correct to do the following?
SetStopLoss(CalculationMode.Price, 1.5 * ATR(24)[0]);
Thank you

Comment