Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Stoploss and Takeprofit in the same Candle
Collapse
X
-
Stoploss and Takeprofit in the same Candle
In the backtest, when I have SL and TP in the same candle , which one will be execute first?Tags: None
-
So even if the candle goes up above your set TP and then back down at or below your SL it will always execute the SL first? That seems wrong.
Comment
-
Hello ATMtrader0001,
Thanks for your reply.
In backtesting the only information available to the strategy analyzer is the OHLC data points of the bar, it does not know if the bar goes up or down first/last, just its finished form. When both SL and PT can be hit in the same bar, conservatively, the SL will be taken.
Comment
-
-
This is wrong?? Replay calculates each tick if the strat/indicator does. When a signal occurs on a certain tick it will be on that tick no matter what speed you use to play.Originally posted by marcus2300
You will have to correct it manually in your report. Watch in a smaller timeframe and you will see in which order things happened.
You should always be very careful with backtesting or replay.
For instance if you use replay, depending of the speed the signal will give a different price. If the speed is 1, every second the signal will be checked; if you put the speed at 50, every 50 seconds the signal will be checked. Checking always happens at the close of the timeframe you use. So in 50 seconds your signal can in reality have any price in this 50 second period, but it will use the price at the end of the 50 second period. So result can be very wrong when volatility is high.
Comment
-
Hello marcus2300,
Thanks for your post.
It appears you are using Chart Alerts in Playback. Please note this information in the help guide: "2) Alerts are not intended to be used with Playback while using an increased speed. Alerts are checked every 200 milliseconds, so using them in Playback could result in an alert not triggering."
Reference: https://ninjatrader.com/support/help...ing_alerts.htm
Comment
-
Hello marcus2300,
Thanks for your reply.
Correct, if you are using/testing alerts in playback you can only go at real time speed as specified in the help guide note.
I have no knowledge of Tickrefresh app so I would be unable to advise.
If you generate a signal from Ninjascript (strategy or indicator) you would not have that timer limitation as it would process according to the bars.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment