Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Simultaneous orders?
Collapse
X
-
Simultaneous orders?
I have two SuperDOM open and I can place different orders on the same instrument. I am never able to place the orders simultaneously. Is there a way to script order placement so that I can place the two orders at exactly the same time?
Tags: None
-
Hello wwjdwade,
Thank you for your post.
The best way to do this would be to write a strategy that adds buttons for multiple order submissions. Orders get sent to the account/instrument. The attached Strategy (Long Short Toolbar Buttons Strategy) gives an example of how buttons may be added for manual order submissions. The strategy could place additional orders with one button press as long as the order submissions do not violate the internal rules of the Managed Approach.
The Managed approach offers you order methods that are wrapped with an invisible convenience layer that allows you to focus on your system's trading rules leaving the underlying mechanics of order management and the relationships between entry and exit orders and positions to NinjaTrader.
Here is a NinjaTrader Help Guide link with information about the Managed Approach - https://ninjatrader.com/support/help...d_approach.htm
If you would like to work around those rules, you will need to use the Unmanaged Approach. The Unmanaged approach offers you more flexible order methods without the convenience layer. This means you are not restricted to any order handling rules besides those imposed by the brokerage/exchange. With such flexibility though, you will have to ensure to program your strategy to handle any and all issues that may arise with placing orders.
Here is a NinjaTrader Help Guide link with information about the Unmanaged Approach - https://ninjatrader.com/support/help...d_approach.htm
Please let us know if we may further assist.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>
-
-
Hello trader3000a,
Thanks for your note.
The buttons in the LongShortToolbarButtons script are created in the OnStateChange() method when the State == State.Historical.
The OnButtonClick method determines what happens when the button is clicked.
And, in OnStateChange() when the State == State.Terminated, the buttons are removed and the OnButtonClick methods are unsubscribed.
Let me know if I 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>
Comment
-
Hi,
I'm not sure I understand. I don't see any new buttons anywhere on the screen when I activate the strategy.
thanks,
David
Comment
-
Hello trader3000a,
Thanks for your note.
Please open a New > Chart window and enable the strategy on the chart. The buttons from the LongShortToolbarButtons script will show on the top-right of the chart.
See the attached screenshot.
See this help guide for information about enabling strategies on a chart: https://ninjatrader.com/support/help...t_strategy.htm
Let us know if we may further assist.<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
-
Hi Brandon,
Ok, thanks. It seems like the strategy must be added to the chart as opposed to the main toolbar's strategies tab, yes?
thanks,
David
Comment
-
Hello trader3000a,
Thanks for your note.
Yes, the strategy must be enabled on a chart window to use it. Not the Strategies tab of the Control Center.
Let me know if I 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>
Comment
-
-
Hello trader3000a,
Thanks for your note.
Yes, this script could be modified to submit an order to multiple accounts when a button is clicked.
You would need to access the Account class in your script, then use <Acccount>.CreateOrder() method to create the order you want to place on the specified account, and call <Account>.Submit() to submit that order to the specified account.
See the help guide documentation below for more information and sample code.
Account: https://ninjatrader.com/support/help...ount_class.htm
CreateOrder(): https://ninjatrader.com/support/help...reateorder.htm
Submit(): https://ninjatrader.com/support/help...nt8/submit.htm
Let me know if I 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>
Comment
-
hi,
sometimes i was instructed to use CreateOrder and Submit to place an order. but sometimes I was told to use EnterLong or EnterShort.
are these equivalent methods for order entry?
thanks
Comment
-
Hello judysamnt7,
It depends on the type of script and what you are trying to acheive.
Account.CreateOrder() and Account.Submit() use the addon approach to submit orders directly to an account. This is used with the addon approach for self-containted addon scripts, indicators, MarketAnalyzer columns, etc.
EnterLong() / EnterShort() are native strategy methods and only work in NinjaScript Strategies. These order methods send orders that affect the strategy position and order update methods like OnOrderUpdate() / OnExecutionUpdate() / OnPositionUpdate().Chelsea B.NinjaTrader Customer Service
Comment
-
Chelsea,
thanks for quick reply.
actually my goal is to : 1) install a chart trader button 2) custom this button to do a pair trading when clicked, meaning submit orders on two different instrument like /ES and /RTY simultaneously.
which method do you recommend to use? Are there any sample codes?
thanks again.
Comment
-
Hello judysamnt7,
If you are just submitting orders on two instruments in a strategy when clicking a button any approach will work.
If you are wanting to managing manually submitted orders and positions the addon approach must be used.
Below is a link to an example of submitting orders with buttons.
And a link to the SampleWPFModifications help guide reference sample which demonstrates adding a button to ChartTrader.
Chelsea B.NinjaTrader Customer Service
Comment
-
Chelsea,
another question around this exercise is :
In order to submit simultaneous orders for two instruments when a button is pressed, which method should I use ? Looks like both OnButtonClick( ) and OnBarUpdate () work. which one is better toward my end?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
578 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment