Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait for order1 to fill before submitting order2

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

    Wait for order1 to fill before submitting order2

    Hi guys,

    I'm have an strategy that puts 3 orders few ticks away from each other. I was wondering how could make the order number 2 wait for the order 1 to fill before submitting...
    My order list looks like that

    Code:
    // Buy	1			
    entryBuyOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, buy_qnt1, offsetBase(1) - orderTypeSign * this.buy_OFFSET1 * TickSize, 0, "Long Limit1_" + Instrument.Id, "Long Limit1");
    						
    								
    // Buy	2							
    entryBuyOrder1 = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, buy_qnt2, offsetBase(1) - orderTypeSign * this.buy_OFFSET2 * TickSize, 0, "Long Limit2_" + Instrument.Id, "Long Limit2");
    						
    // Buy	3 
    entryBuyOrder2 = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, buy_qnt3, offsetBase(1) - orderTypeSign * this.buy_OFFSET3 * TickSize, 0, "Long Limit3_" + Instrument.Id, "Long Limit3");
    Thanks very much in advance!

    #2
    If your strategy does bar updates every tick, then you could just check for a position size/state every tick, but that's not terribly elegant. If you use IOrder objects, you could check specifically when the first order was executed in the OnExecution() method.

    Comment


      #3
      coolmoss i'm new to this to this (c#)... Could you explain more?
      Basically i just want my orders to wait for previous order to fill before the next one will be submitted. I need that to protect me from Daily Raw Messaging Tier on CME.

      Comment


        #4
        There are a number of IOrder properties you can reference to have the strategy only take action when that order is in a certain state.



        We don't have an exact example of what you're trying to do, but I'm including a few reference samples which use IOrders:

        When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until


        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()


        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        65 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X