Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Multiple accounts
Collapse
X
-
Multiple accounts
Hi, I have an account for my 401k and a regular account, is there away or add-on already out there that when I place an ATM trade, it execute both account for me?
Tags: None
-
Hello thaison316,
Thank you for writing in.
I understand that you would like to submit an order using an ATM Strategy to one account and have the same order submitted on a second account.
Account-level OrderUpdate events could be used to pick up orders from one account and submit orders to another account. To accomplish this, you would need to create a script that subscribes to account-level OrderUpdate events to monitor orders sent to the first account. Then, in OnOrderUpdate you could check if an order is filled and if the order is long or short. If the order IsLong, then you could use CreateOrder() to create a buy order and use StartAtmStrategy. Submit() to submit the order to the second account. If the order IsShort, you could use CreateOrder() to create a sell order and use Submit() to submit the order to the second account.
Please see the attached example script that demonstrates how this is accomplished.
Also, please see the following help guides linked below for more information.
OrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm
Submit() — https://ninjatrader.com/support/help...t8/?submit.htm
StartAtmStrategy - https://ninjatrader.com/support/helpGuides/nt8/startatmstrategy.htm
Let us know if we may further assist.Attached FilesBrandon H.NinjaTrader Customer Service
-
The CheckATMOrderAcc1SubmitOrderAcc2 file results in the second account being sold or bought twice instead of once. Also is there a way to ensure that the price of both accounts' executions be the same on entry, because the second account is getting a one tick delay.
Comment
-
Hello Peace2Keep,
Thanks for your note.
I do not see the same behavior you are reporting when running the script attached in post #2. When a trade is placed on the first account, the same order quantity is placed on the second account.
See the demonstration video I have made showing this: https://brandonh-ninjatrader.tinytak...Nl8xOTM5MjQ5NQ
Something you could consider is modifying the CreateOrder() methods in the script to use "e.Order.Quantity" instead of a quantity of 1. By doing this, the total order quantity placed would be used to place an order on the second account instead of a quantity of "1".
Also, there would not be a workaround for the slight delay between order submissions on the second account.
Let us know if we may assist further.
Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kramnor2001, Yesterday, 02:30 PM
|
3 responses
20 views
0 likes
|
Last Post
by kramnor2001
Today, 09:20 AM
|
||
Started by ninza33, Today, 09:10 AM
|
0 responses
1 view
0 likes
|
Last Post
by ninza33
Today, 09:10 AM
|
||
Started by Padan, Today, 02:02 AM
|
3 responses
11 views
0 likes
|
Last Post Today, 08:54 AM | ||
Started by Tim-c, Today, 08:36 AM
|
1 response
3 views
0 likes
|
Last Post Today, 08:45 AM | ||
Started by goodknight777, Today, 08:43 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 08:43 AM |
Comment