I am using NT8. 8.0.21.1 64-bit.
With tick replay backtest.
1 minute Bar update.
I used the method suggested from the previous thread to set the TP and SL position and found that SL is missed.
OnBarUpdate()
{
SetProfitTarget("Trade_001", CalculationMode.Price, 0.65588);
SetStopLoss("Trade_001", CalculationMode.Price, 0.65427, false);
EnterLong(1, "Trade_001");
}
I use another method. SL is detected.
OnBarUpdate()
{
EnterLong(1, "Trade_001");
}
OnMarketData(MarketDataEventArgs marketDataUpdate)
{
if (condition okay) // tp or sl
{
ExitLong(1);
}
}
Q: What is the official way or the right way to handle this SL/TP setting during backtest and live trading ?
Q: In both case I set the SL position at 0.65427, which should hit by the following bar, but both case did not simulate at the right position, is it a setting problem ?
Thank you very much.

Comment