Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy behavior in playback vs live
Collapse
X
-
Strategy behavior in playback vs live
I have a strategy that, among other things, draws lines on my chart when an order is filled and enters a stop loss order. It works perfectly in playback mode drawing all of the correct lines in the correct places and entering the correct stop loss order. When in live mode, it doesn't draw any lines or enter any orders. I used Strategy Builder to create the strategy as I am not fluent in NinjaScript.Tags: None
-
Hello SheriDi,
Initially you said no orders were placed but now you said an initial order was placed. Was the order that was placed a live order and what part specifically is not working after that when running it live?
Are you referring t oa stop order that was not placed? If so how are you submitted the stop order, was that from the stops and targets page or are you using a set to submit the stop?
Comment
-
Hello SheriDi,
Yes in that case it sounds like the condition is just not becoming true from some reason. There are a few ways you can diagnose that, the easiest would be to use prints or drawing objects. With the strategy builder the easiest way to know why a condition is not true would be to do the following:- Add a new empty set with no condition
- In the actions use Misc -> Print
- In the print dialog add any indicator values or variables that you used in the condition that is not working and then run the strategy.
- That will let you use the NinjaSCript output window to see what values the strategy is calculating and using to get a better idea of the problem.
- For price values like indicators or prices you calculate for the stop price you can also use drawing objects in that extra set to display their value constantly.
If the strategy is listed as yellow that relates to when the initial order was placed. That means the strategy entered into a historical position and then transitioned into realtime. It would now be waiting to exit that position before working in realtime. If you don't have any exit sets then it will just remain yellow and not exit. To avoid that you can reduce the amount of historical data being used so it cannot place that trade. Alternatively you can add a condition to check the state and make sure the state is realtime to prevent it from trading historically.
You can read about the strategies start behaviours here:
I would also suggest to use a demo or sim account while figuring this part out just to avoid entering into positions that you need to manually close.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
143 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
76 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
47 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
51 views
0 likes
|
Last Post
|

Comment