Look at the attached bar chart. In my opinion, the backtester should not have stopped me out.
My code has:
EnterLongStop(471.7, "le1");
SetStopLoss(CalculationMode.Ticks, 8);
Of course with just OHLC bar data we don't know for sure what happened intrabar, but just a casual look at the entry (and exit) bar would suggest that after the open at 470.5, we next made the low at 470.5 then the high at 472.1 then the close at 472.1. Not that its needed but the 14:07 bar, I think, helps reinforce this assumption.
However, look at how NT executed these fills. It put me long at 471.7 (correct) then stopped me out at 470.5 (suspect). For this to have actually happened, on the 14:06 bar the market would have had to trade up to at least 471.7 (long entry fill) then down to at least 470.5 (stop loss fill) then back up to 472.1 (the close).
Not to keep harping on Tradestation, but Tradestation's backtester would look at the 14:06 bar, and see that the open is near the low of the bar and close is near the high of the bar and assume the bar sequence was: open, low, high, close. And as such would not have stopped out at 470.5.
Before I start studying @LiberalFillType.cs, I thought I might ask is it possible for a lowly little paying customer such as myself, to change the fill behavior of NT's backtester to mimic the way Tradestation does it? That is, look at the relationship of the close (and perhaps open) to the high and low of a bar to define the sequence that limit and stop orders are filled.
If so, any hints or examples would be greatly appreciated.
thanks,
shawnj
Comment