Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi instrument position monitoring

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

    Multi instrument position monitoring

    I have a strategy working but would like to run it on two separate instruments, instrument 1 and instrument 2. If instrument 1 is Long, only Short positions can be initiated in instrument 2, and vice verse. I assume I have to create a single strategy for this but I don't know if Position.MarketPosition command can reference the second instrument. Do any examples or threads exist on this?
    Any direction is appreciated.

    Travis

    #2
    Hello Travis,
    Thanks for writing in and I am happy to assist you.

    You have to create a multi-series strategy to do it. Please refer here to know more



    You can use the Positions function to find the current postion for the 2 instruments. Please refere here to know more



    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you for the reply. It was very helpful. I'm now stuck with setting targets for each instrument individually. I have multiple events that use Target 1 and multiple events that use Target2. Assume the following: I'm long Instrument1 with Target1. Instrument2 enters a short with Target2. Instrument1 then changes it's target to Target2 which I do not want. This is what occurs if I use no naming of the exits. I need to keep my targets for Instrument1 and Instrument2 independent but can not figure out how. I've tried naming them to keep them separate but without success. Can you point me to any examples?
      Code:
      if (x=y)
      			{
                      EnterShort(1, "");
      				SetProfitTarget("", CalculationMode.Ticks, Target2);

      Comment


        #4
        Hello Tdschulz,
        You have to give unique names to each orders, and link it with the Set() orders.

        Code:
        EnterLong(1, "Long on ES");
        SetProfitTarget("Long on ES", CalculationMode.Percent, .02);   //Set order is tagged with the Entry order named "Long on ES".
        You can also refer to this sample code which is on similar lines
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I don't think I want unique order handling because I scale IN to a position and then set my target based on my average position price, not unique entry points. What makes this complicated is the Second Instrument in the strategy. Is there a way to use "SetProfitTarget()" but only have it apply to the BarsInProgress instrument?
          Once I have two or more contracts on the same instrument, I want to change the target to a profit on the new avg price.
          Is there another sample or section which gives a more detailed description of using Tags?

          Comment


            #6
            Hello Tdschulz,
            You can set the unique names even for the multi - instrument strategy and change the orders as and when required.

            Unfortunately we do not have any detailed sample code regarding this. You can however also refer to this http://ninjatrader.com/support/forum...ead.php?t=3225
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            659 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            374 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            579 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X