Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same strategy, multiple accounts

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

    Same strategy, multiple accounts

    Question for you guys:

    I'm looking to execute the same strategy for multiple accounts. I do not yet have the ability to aggregate all orders and allocate them via Interactive Brokers - I can only submit orders on a per-account basis.

    If I create two versions of the same strategy, running the same instrument, which differ only in the target account for orders, in what order are trades submitted? Does this cause problems with Interactive Brokers?

    #2
    Hello cgeorgan, and thank you for your question.

    If you have multiple instances of your strategy open to different accounts, they will trade asynchronously, or in other words, with no guaranteed order between them. You would have to use custom programming in order to allow your strategies to communicate in order to gain control over which order things are submitted in. While I recommend contacting Interactive Brokers to discuss how your accounts are set up, I do not forsee any issues running 2 strategies on 2 different accounts in 2 different charts.

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Not Quite True

      Originally posted by NinjaTrader_JessicaP View Post
      Hello cgeorgan, and thank you for your question.

      If you have multiple instances of your strategy open to different accounts, they will trade asynchronously, or in other words, with no guaranteed order between them. You would have to use custom programming in order to allow your strategies to communicate in order to gain control over which order things are submitted in. While I recommend contacting Interactive Brokers to discuss how your accounts are set up, I do not forsee any issues running 2 strategies on 2 different accounts in 2 different charts.

      Please let us know if there are any other ways we can help.
      I wanted to follow up on this, because this advice did cause a few problems.

      It should be noted that Interactive Brokers does not allow for allocation instructions. While you can attempt to pre-define allocations at TWS, if you get odd fills you can run into instances where TWS will throw out an exception, causing any automated strategies to cease.

      The only solution - as far as I can see - is to run the same strategy with different accounts. This did create a further problem, as I would generate trades that basically had the same name (Instrument, date, amount, time). I had to get around this by inserting the Account Name into the trade string to avoid collisions.

      FYI.

      Comment


        #4
        Thank you cgeorgan for this information, and for this correction to the advice I gave. I am positive the community will be better off thanks to this additional information.

        If it would not be too much trouble, would it be possible to provide us with a very basic example of a strategy that can be implemented on a single account, including where you insert the account name into a trade string?
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_JessicaP View Post
          Thank you cgeorgan for this information, and for this correction to the advice I gave. I am positive the community will be better off thanks to this additional information.

          If it would not be too much trouble, would it be possible to provide us with a very basic example of a strategy that can be implemented on a single account, including where you insert the account name into a trade string?
          I can't imagine a strategy that wouldn't be able to run on multiple accounts. However, when you're trading something highly liquid - like CL, ES, etc., - then having a trade string with just Instrument/date/amount/time will be insufficient. Here is an example of an execution string that will work, where the account name is included to prevent execution collisions:

          Code:
          SubmitOrder(0, OrderAction.Sell, OrderType.Market, positionSize, 0, 0,"", 
          Positions[BarsInProgress].Account.Name + "_" + Instrument.FullName +
           "_" + "Entry_" + Time[0]);

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ghoul, Today, 06:02 PM
          2 responses
          13 views
          0 likes
          Last Post ghoul
          by ghoul
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          44 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          180 views
          0 likes
          Last Post jeronymite  
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          13 views
          0 likes
          Last Post DanielSanMartin  
          Working...
          X