I'm studying NinjaScript and working with trailing stop losses today. I submit a trailing stop of 20 points for every long trade:
// Manage stops for open positions if (Position.MarketPosition == MarketPosition.Long) { // Trail stop of 20 points SetTrailStop(CalculationMode.Ticks, 20 * (1 / TickSize)); }
(first attached image)
But there are also some cases that look very odd on historical data:
(second attached image)
Here the trade fills on the open, but is also closed at the open. That happens because the open is more than 20 points away from the bar's high.
But of course that high happened later in time than the open did. So why does the trail stop fill at the open?
I read the historical order backfill (https://ninjatrader.com/support/help...fill_logic.htm) page, but my comprehension of that page doesn't help me understand this situation.
Thanks for any insights!
Comment