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