Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

two opposing entry limit orders?

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

    two opposing entry limit orders?

    the internal order handling rules are currently preventing me from trying an idea out. how should I go about placing two opposing orders for something like the following?
    Code:
    EnterLongLimit(bidprice, "buy bid");
    EnterShortLimit(askprice, "sell ask");

    #2
    Hello,


    This is expected behavior. You will need to build a condition that triggers when price has reached the price that you would have otherwise placed the Limit order.

    Note you cannot place simultaneous opposing order in NinjaScript.
    DenNinjaTrader Customer Service

    Comment


      #3
      I've just run into the same problem trying to set up a straddle strategy. Basically:

      EnterLongStop(highpoint, "we broke resistance");
      EnterShortStop(lowpoint, "we broke support");

      I assume the purpose of the internal order handling rule that stops me from doing this is so that I don't accidentally have both orders trigger and hence not know what, if any, position I'm in.

      It would be nice if instead of having this rule NT could automatically link the two orders OCO, or alternatively allow the rule to be turned off.

      Comment


        #4
        Hello,

        Yes, again this is expected behavior: two opposing orders/positions.

        I will send your suggestion to our development department for consideration. Thank you!
        DenNinjaTrader Customer Service

        Comment


          #5
          after trying to come up with a solution for placing two opposing orders, i gave up.

          i'd like to request a feature that allows this type of behavior, like something in the initialize section "InternalOrderHandling.AllowOppositeOrders = true".

          thank you.

          Comment


            #6
            Thank you for the suggestion. Currently you cannot place simultaneous opposing orders in the same market from the same strategy.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              Is this still the case with NT6.5 or NT7?

              Thanks!
              jon

              Originally posted by NinjaTrader_Josh View Post
              Thank you for the suggestion. Currently you cannot place simultaneous opposing orders in the same market from the same strategy.

              Comment


                #8
                Hello,

                Since you are asking about NT7, I will have someone reply to you on Monday. Thank you for your patience.

                For NT6.5, it is still true.
                DenNinjaTrader Customer Service

                Comment


                  #9
                  Ben,

                  Has anyone gotten to this yet? I would like to create one OCO order and handle the cancelling of the order on my own. However, it seems like I cannot short and go long (via two opposing stop or limit orders within the same strategy). Is this true?

                  This is what I want:

                  At a certain time, I want to submit an two orders (one short, one long).
                  If one gets filled, I want to cancel the opposing order.

                  I understand I will need to handle the cancelling using OnOrderUpdate or OnExecution. If this is not allowed, then what is the purpose behind EntriesPerDirection? I'm essentially placing the same quantity on opposing sides. Once a fill occurs on one side, I will cancel the working order via CancelOrder.

                  Again, if this is not possible (entering opposing limit or stop orders) then why have EntriesPerDirection??

                  thanks!
                  jon

                  Originally posted by NinjaTrader_Ben View Post
                  Hello,

                  Since you are asking about NT7, I will have someone reply to you on Monday. Thank you for your patience.

                  For NT6.5, it is still true.

                  Comment


                    #10
                    Jon, with this approach you're running into the Internal Order Handling Rules - http://www.ninjatrader-support.com/H...verview36.html (bottom section here).

                    Those exist in NT 6.5 and still exist per default in NT7, however with NT7 we also offer a completely new unmanaged order submission feature where you could custom code exactly what you need using the SubmitOrder, ChangeOrder and CancelOrder methods in NinjaScript.



                    New Unmanaged Order Submission
                    In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.

                    Comment


                      #11
                      Bertrand,

                      So with NT7 and the unmanaged order submission feature, I can SubmitOrder() two limit orders on opposing sides withing 1 strategy for the same market?


                      thanks!
                      jon

                      Originally posted by NinjaTrader_Bertrand View Post
                      Jon, with this approach you're running into the Internal Order Handling Rules - http://www.ninjatrader-support.com/H...verview36.html (bottom section here).

                      Those exist in NT 6.5 and still exist per default in NT7, however with NT7 we also offer a completely new unmanaged order submission feature where you could custom code exactly what you need using the SubmitOrder, ChangeOrder and CancelOrder methods in NinjaScript.



                      New Unmanaged Order Submission
                      In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.

                      Comment


                        #12
                        Yes, as with Unmanaged set to 'true' in the Strategy Initialize() you would not get 'ignored' orders then as the Internal Order Handling Rules are not at play then under the hood.

                        Comment


                          #13
                          Bertrand,

                          Beautiful! This is perfect. I tested this and it works nicely.
                          Now moving on to supporting StopLoss and ProfitTarget collars on all unmanaged orders. I don't suppose I could use some of the NT functionality for this on an unmanaged strategy (like setStopLoss or setProfitTarget)?

                          THANKS!
                          jon


                          Originally posted by NinjaTrader_Bertrand View Post
                          Yes, as with Unmanaged set to 'true' in the Strategy Initialize() you would not get 'ignored' orders then as the Internal Order Handling Rules are not at play then under the hood.

                          Comment


                            #14
                            Correct, in unmanaged strategies only SubmitOrder, CancelOrder and ChangeOrder can be called...as their no NT signal tracking being applied and used. For the 'freedom' you gain you have to self manage order tracking aspects then in your code (storing as IOrder references).

                            Comment


                              #15
                              Bertrand,

                              I was trying to have my cake and eat it too. In any case, how do I monitor the last price? NT needs more documentation regarding this NT7 feature.


                              thanks!
                              jon

                              Originally posted by NinjaTrader_Bertrand View Post
                              Correct, in unmanaged strategies only SubmitOrder, CancelOrder and ChangeOrder can be called...as their no NT signal tracking being applied and used. For the 'freedom' you gain you have to self manage order tracking aspects then in your code (storing as IOrder references).

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              668 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              377 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 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
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X