Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi instrument index order

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

    Multi instrument index order

    Hi

    I have written a strategy which has good backtests in the SP500. I'm now mirroring the trades in ES because you can't trade the index and if I apply my strategy on the ES performance drops.

    I simply added ES as secondary instrument and enter/exit trades when together with SP500. All works fine in backtests, market replay, and sim trading with Kinetick live data.

    Now I'm worried because some of the exit logic is based on Position.AvgPrice calculation and when I will trade the strategy the orders for the index (which were fine for sim) will be rejected by IB. Am I right that, as a consequence, there is no Position.AvgPrice for the SP500 and my exit logic wont execute? If yes, is it possible to 'simulate' the position within the strategy?

    Any help is very much appreciated,

    Marco

    #2
    Hello Marco,

    Thank you for your post.

    If the orders are rejected (i.e. not allowed to trade the index) then there will be no AvgPrice. You will need to submit the orders to a supported instrument for the broker/data feed provider.

    In this case if you wanted the orders to go to the Es you could use the barsInProgressIndex of the Enter() methods or SubmitOrder() method to submit the order to the ES. If the ES is the first instrument added then it's barsInProgressIndex will be 1.

    For information on working with multiple instruments please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thank you for your reply PatrickH!

      Maybe I should clarify what I was asking. I already use the barsInProgressIndex of the Enter() method to route my trades to ES (index 1) when the SP500 (index 0) generates a signal. But I need my Exit logic to use the 'theoretical' AvgPrice of a simulated SP500 trade. Please tell me if you want me to be more precise.

      Marco

      Comment


        #4
        Hello Marco,

        Thank you for your response.

        I beleive you wish to place simulated orders to the index and use that position information for your live trades. Unfortunately the strategy can only be applied to one account for each instance of the strategy and strategies cannot communicate to one another.

        However, you may be able to create your own internal logic to track these fake trades and position information. You could track the entry price in your one variable and then compare to the current price for example.

        Please let me know if I may be of further assistance.

        Comment


          #5
          PatrickH,

          That's what I wnated to know. I already had thought of storing the fake trade entries and run the calculations with those variables. Unfortunately this makes thing a little more complicated, the two account solution would have saved me some time.

          Thanks anyways!

          Marco

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by adeelshahzad, Today, 03:54 AM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by RookieTrader, Today, 07:41 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by kujista, Today, 05:44 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by elderan, Yesterday, 08:03 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by samish18, Yesterday, 08:57 AM
          8 responses
          25 views
          0 likes
          Last Post samish18  
          Working...
          X