Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Random Strategy disabling
Collapse
X
-
Random Strategy disabling
I'm running things through playback to test and be sure that things are working like they should. I have a script that says when 2 minutes to market close happens (on that bar) just exit market, close me out. Sometimes it works. Sometimes it just kills my whole strategy and turns it off. The output is reading normally until I get a "Disabling NinjaScript strategy '[StrategyName]/347949798'" No idea what makes it happen. Seems to be inconsistent (sometimes on one day, but not on the day if you run it through again). How do I find out what is taking executive authority to kill my strategy?
Tags: None
-
Hello alphatango,
Auto close position can disable a strategy.
Calling CloseStrategy() in the strategy code can disable a strategy.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Calling SetState() in the strategy code can disable a strategy.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Calling <Account>.Flatten() from any script can disable working strategies on the same instrument and account.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
A run-time error will disable a strategy.
A order error can disable a strategy, depending on the RealtimeErrorHandling.
Chelsea B.NinjaTrader Customer Service
-
I don't run <account>.Flatten(), SetState(), or CloseStrategy(). I did have AutoClose. I run through a prop firm and they're vehement on not holding past 1pm (PST). I have a ExitLong/ExitShort script that runs at 12:59. It just closes me out wherever. if I turn off AutoClose, do I leave anything to chance by just relying on my strategy to get me out?
Also if it's a runtime error, where would that show up? Maybe I can find the cause.
Comment
-
Hello alphatango,
The 'Auto close position' will disable all running strategies.
If you don't want the strategies to be disabled at the set time, you will need to disable 'Auto close position'.
A strategy can exit positions a number of seconds before the end of a session with the 'Exit on session close'.
The strategy can also control when it enters and exits with time conditions.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Run-time errors appear on the Log tab of the Control Center.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
38 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 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