Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Life of unfilled orders

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

    Life of unfilled orders

    I am working on a multi-Time frame strategy which places both Stop and Market entry orders. The orders are placed from the BarsInProgress==0 region but are indexed to the lower time frame.
    My question is reagrding the "life" of the order. I know that the order is cancelled at the end of the current bar and must be resubmitted. Does this have to be done in the lower timeframe or will the order be "live" until the next onbarupdate call from the primary time frame?

    #2
    clfield,

    I believe it will need to be kept alive on all BarsInProgresses. An easy way to work with this would be to just use liveUntilCancelled = true for the orders and then you won't need to worry about resubmissions.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      If I set it up as you suggest would I need to actually cancel each order if it did not fill and my entry condition was not met on the next bar? Also what about updating the Stop price in the StopEntry entry?

      Comment


        #4
        You would indeed need to cancel the order when your condition is no longer true. This can be done through a simple call to CancelOrder().

        Updating stop prices works like how it does before. If you want to modify the order, call the order again to make the change.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you for your replies.

          I was thinking could I put the order placement in at the end of the OnBarUpDate after all the BarsInProgress calls so it would be run every time OnBarUpDate was called regardless of which Bars Object initiated the update?

          Comment


            #6
            clfield, this is also an option (don't filter OnBarUpdate calls), but it may be easier to submit it as liveUntilCancelled and then cancel if needed.

            Comment


              #7
              Thank you for the confirmation.

              Can the StopEntry price be undated each bar without first canceling the existing StopEntry order?

              Comment


                #8
                Not sure I follow what you mean by 'undated', if you want to move the stop price to a new leve, just resubmit the order with the new stop price to make the modification.

                Comment


                  #9
                  Thanks for the clarification. So if I am staying with the same type of Entry order IE Stop or Limit or StopLimit I do not need to cancel the previous roder than submit a new one with the new Entry Price? But if I am going to change the type of Entry then I would need to cancel the previous order before submitting the new one.

                  Comment


                    #10
                    Correct, for a new price, just resubmit the order to change it.

                    Comment


                      #11
                      When using the technique where the order is placed each OnBarUpdate and not kept live until canceled and I change from a StopEntry to a Market or Limit Entry Order and I want to use the same IOrder entry name I won't I have to wait for confirmation of the canceled order in the OnOrderUpdate method before submitting the the new order to avoid losing the order info?
                      I am trying to avoid having to manage stops and targets for two seperate IOrder objects.

                      Comment


                        #12
                        I do not recommend using the same IOrder object for separate orders. If you do you should wait for confirmation on a terminal state of the original order before replacing the object with the new order. If you don't wait for confirmation you run the risk of the order not going terminal and you lose all ability to control it after you overwrite the references.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Where would be the best place to check for the Terminal state, OnExecution or OnOrderUpdate? I understand what you are saying about losing control of the order. The problem with seperate IOrder objects for each entry type comes when you place and manage the stop and target orders after the entry order has filled.

                          Comment


                            #14
                            clfield,

                            Best would be OnOrderUpdate().
                            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
                            633 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            364 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            105 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            567 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            568 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X