Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy builder order issue
Collapse
X
-
Strategy builder order issue
I’m using the strategy builder. For some reason the system is firing the limit order at the open of the next day instead of on the candle when the trigger occurs. I’m using the 1 second chart. The data and price of the trigger print fine in live time but the order for some reason fires at the open of the next day. Anyone ever see anything like this?Tags: None
-
Hello Shiner452,
Thanks for your post.
If your strategy is set to run in the mode of Calculate.OnBarClose which means that the strategy code executes once at the end of each bar and will perform calculations on completed bars. If your strategy determines to enter an order, the order would be placed on the next bar. In this mode, your strategy will operate the same historically as it does when connected to real-time (or replay) data.
Using the calculate mode of Calculate.OnPriceChange, or Calculate.OnEachTick, will allow the strategy to be executed intrabar with greater frequency which means your code will be executed on each tick or each change in price. Depending on the bar size and market volatility this can be a significant number of times per bar. You would be working with data that could change and your strategy conditions could change from one tick to the next. Entry orders would be executed intrabar instead of waiting until the next bar.
To determine exactly how the script is behaving and placing orders, debugging prints should be added to the script.
Below is a link to a forum post that demonstrates how to use prints to understand behavior.
https://ninjatrader.com/support/foru...121#post791121
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Thanks so much for your response. I have it set on ‘on price change’. I have attached a few pics. You can see it is entering with a limit order. The limit order price is shown on the output window and that is updating as it should. I have the order set to have no criterion at all so it should be firing. Maybe after looking at this it may give you an idea.
I’ve written several strategies that work fine so I’m incredibly confused here.
Last edited by NinjaTrader_BrandonH; 04-03-2023, 09:42 AM.
Comment
-
Hello Shiner452,
Thanks for your notes.
Does the strategy appear yellow in color on the Strategies tab of the Control Center?
Do you see any error messages appear in the Log tab of the Control Center?
I have attached a simple example script that demonstrates submitting a short limit order using the EnterShortLimit() method in the Strategy Builder and submitting Exit methods for the stop and target once the entry order is filled.
You could compare this example script to your script to get an idea of how to use EnterShortLimit() within a strategy.
See the help guide documentation for more information.
Conditions: https://ninjatrader.com/support/help...on_builder.htm
Actions: https://ninjatrader.com/support/help...t8/actions.htm
Please let me know if I may assist further.Attached Files<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
51 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
129 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