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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    661 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    375 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X