Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Script wont place orders after trying to Increase order size
Collapse
X
-
Script wont place orders after trying to Increase order size
Hi. I have written some code in my strategy to try and have the order size increase based of if there is a flip in my position direction. So on the first switch to longs if we were previously short we increase the size by +1. And visa versa for shorts. After adding all my logic, the script is no longer placing in trades when I test it in the script analyzer and backtest it. Can anyone help me figure out what Might be causing this? Thanks -
Hello agclub,
The TraceOrders would tell why orders are being ignored or automatically cancelled.
Enable TraceOrders in State.Configure and save the output to text file and include this with your next post.
Below is a link to a support article on using TraceOrders and Print() to understand behavior.
Chelsea B.NinjaTrader Customer Service
-
Hi chelsea. Thanks for the reply. I have added some print statements and the TraceOrders line as per the article, but I see no output of any kind in my NinjaScript Output window. What would you suggest trying next?Originally posted by NinjaTrader_ChelseaB View PostHello agclub,
The TraceOrders would tell why orders are being ignored or automatically cancelled.
Enable TraceOrders in State.Configure and save the output to text file and include this with your next post.
Below is a link to a support article on using TraceOrders and Print() to understand behavior.
https://support.ninjatrader.com/s/ar...nd-TraceOrders
Comment
-
Correct. And still no output when i compile. Kindly see the imagesOriginally posted by NinjaTrader_ChelseaB View PostHello agclub,
May I confirm you have set TraceOrders = true; in State.Configure and not in State.SetDefaults?
Have you opened the NinjaScript Output window making the change and compiling and then reloaded the script?
Comment
-
Hello agclub,
May I confirm you have reloaded the script after making the changes and compiling?
Are there errors appearing on the Log tab of the Control Center when enabling the script?
Add Print(Time[0]); to the top of OnBarUpdate and reload the script, do you see this print appearing in the output window?
Is the Strategy showing with the Enabled checkbox checked on the Strategies tab of the Control Center?Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, 03-13-2026, 05:17 AM
|
0 responses
86 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
151 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
79 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
52 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
59 views
0 likes
|
Last Post
|

Comment