Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiInstrumentStrategy. Order token changes.

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

    MultiInstrumentStrategy. Order token changes.

    Hallo.

    How to get the code represent 2 order tokens, what return false if one of them will change, return true if both are changed?
    Rgds
    Czarek

    #2
    Czarek,

    Not sure what you mean. If you have two different orders, use two different IOrders and then you will have two different tokens. Otherwise, one order will have one token.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I ahave 2 instrument strategy (NQ and ES). If NQ is long ES should be short and up side down. So two orders are open all time and I have 2 different tokens. If I rewers one of the order one unique token will be changed automaticly. Than I need the code sentence whih return me "false" if one of tokens will be changed, than return "true"when the second token will be changed. Could you advise me how to make such code or give any samples whih help.

      Comment


        #4
        Unfortunately I am still not following you. If you change your position through another order, just assign it to a new IOrder. Not understanding you on why you need to check for tokens. If you submit a new order you then its changed.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Strategy all time calculate some factors whih generate signals for rewerse positions. ESLong rewers to ESShort, NQShort to NQLong and keep opposite positions all the time. If rewers signal appeare 2 revers orders are placed, one for each instrument. In real market it take some time to rewerse both instruments. I would like to hold factor calculations from the rewers signal untill both instrument have been reversed ( fully filled). My idea is to make flag whih return me false when the first order will be reversed and keep it false until the second order will be filled. So I would like to make it based on order token. When one token will be changed return false and when both token will be changed retun true. I'm not sure if this is good idea. I would like to ask you to help me to type such code or give me another idea.
          Rgds
          Czarek

          Comment


            #6
            Czarek,

            Sorry not understanding you. If you want to keep information just use separate IOrders. Anything you want to check just base it off of the IOrders. If you want to wait till both have been filled just check both the IOrders for the correct order state. When both are filled then set whatever variable you want to true.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Ok, I will try to make it based on order state. Do I have to BarsInProgres to specify instrument or separete IOrders are enoguht?
              Czarek

              Comment


                #8
                Separate IOrders should do it.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Are there any more possible states for entry market order (EnterLong()) than: Pending, Fliied, PartialFilled, Cancelled??

                  Comment


                    #10


                    Please see the list there.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    670 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    379 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    111 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    575 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    582 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X