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!
See more
See less

Partner 728x90

Collapse

Multiple accounts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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 Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      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


        #4
        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 geotrades1, Today, 10:02 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by ender_wiggum, Today, 09:50 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by rajendrasubedi2023, Today, 09:50 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bmartz, Today, 09:30 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by geddyisodin, Today, 05:20 AM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X