Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Concurrent Orders

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

    Multiple Concurrent Orders

    I have a strategy that tries to place 2 simultaneous limit orders in the simulator, 1 order above the market, 1 below the market. But only the first order in the strategy shows up on chart trader, the 2nd order seems to get lost. Both orders show up in the TraceOrders output log, but only the first one shows up on the chart. How do I place concurrent orders above and below the market?

    Here's my reproducible strategy test code:

    protected override void Initialize() {
    CalculateOnBarClose = true;
    TraceOrders = true;
    EntriesPerDirection = 1000;
    EntryHandling = EntryHandling.AllEntries;
    }

    protected override void OnBarUpdate() {
    double hi = High[1] + (10*TickSize);
    double lo = Low [1] - (10*TickSize);

    Print("Bar " +CurrentBar +" Buy "+lo +" Sell " +hi);
    EnterLongLimit ( 1, lo );
    EnterShortLimit( 1, hi );
    }

    Here's the output:

    Bar 148 Buy 1920.25 Sell 1926.75
    5/16/2010 3:10:01 PM Entered internal PlaceOrder() method at 5/16/2010 3:10:01 PM: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1920.25 StopPrice=0 SignalName='' FromEntrySignal=''
    5/16/2010 3:10:01 PM Entered internal PlaceOrder() method at 5/16/2010 3:10:01 PM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=1926.75 StopPrice=0 SignalName='' FromEntrySignal=''
    Last edited by monpere; 05-16-2010, 02:15 PM.

    #2
    Hello monpere,

    Thank you for your post.

    You are running into our internal order handling rules, found here:



    Methods that generate orders (excluding market orders) to enter a position will be ignored if:
    • A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
    • A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
    • The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
    You would have to move to an unmanaged approach in version 7 to support two limit orders in the opposite direction.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    55 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X