Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO Question

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

    OCO Question

    Hi,

    I'm trying to use the managed approach to submit an OCO order? Is this possible? What I want is a longlimit buy order and a buystop order submitted at the same time. Whichever gets filled first, the other is cancelled.

    Thanks,

    Rich

    #2
    Hi Rich, so you would place basically 2 buy orders in this setup then?

    Comment


      #3
      Yes, but only have 1 filled.

      Comment


        #4
        What entry handling are you using here? Have you checked with TraceOrders?

        Comment


          #5
          I'm using one entry per direction, all entries, and perentryexecution for stop and target submission. I do have traceorders enabled. I could make them unique orders and submit them, but how do I cancel the other order when one is filled?

          Comment


            #6
            For this OCO type handling, you would need to check their fillstates in OnExecution() and CancelOrder() then as needed when part of the bracket is filled - http://www.ninjatrader.com/support/h...nexecution.htm

            Comment


              #7
              Can I do this under the managed approach or do I have to use the unmanaged approach?

              Comment


                #8
                This is possible in the managed and unmanaged approach -

                The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


                Generally you would need to be aware of the managed approach order handling rules though mentioned in the botton section here :



                If you run into those scenarios it can be easier and more flexible to move to the unmanaged approach :

                Comment


                  #9
                  I'm a little confused because all of the examples show OnExecution being used with the IOrder objects, which I understand to be the unmanaged approach. How do I differentiate one order from another in OnExecution?

                  My two orders are:
                  EnterLongLimit(quantity, target, "LimitFilled");
                  EnterLongStop (quantity, stop, "BuyStopFilled");

                  Comment


                    #10
                    IOrders are part of both approaches, they are just an advanced and more flexible way of managing your orders. You would assign an IOrder object for both orders you would work with - http://www.ninjatrader.com/support/h...nt7/iorder.htm

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by CarlTrading, 03-31-2026, 09:41 PM
                    1 response
                    67 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by CarlTrading, 04-01-2026, 02:41 AM
                    0 responses
                    36 views
                    0 likes
                    Last Post CarlTrading  
                    Started by CaptainJack, 03-31-2026, 11:44 PM
                    0 responses
                    60 views
                    1 like
                    Last Post CaptainJack  
                    Started by CarlTrading, 03-30-2026, 11:51 AM
                    0 responses
                    62 views
                    0 likes
                    Last Post CarlTrading  
                    Started by CarlTrading, 03-30-2026, 11:48 AM
                    0 responses
                    53 views
                    0 likes
                    Last Post CarlTrading  
                    Working...
                    X