Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsInProgress in Multi Instrument and simultaneous executions

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

    BarsInProgress in Multi Instrument and simultaneous executions

    Hello,
    I am developing a strategy that executes simultaneous orders on two different instruments. One of the instruments is ES 12-17 and the other is ES 09-17.

    The second expiration ES (12-17) has lower amount of historical data due to lower volumes.


    I am executing my orders with the following code:

    "
    if (Positions[0].MarketPosition == MarketPosition.Flat)
    {
    EnterShort(0, 1, "Short Alpha");
    }
    if (Positions[1].MarketPosition == MarketPosition.Flat)
    {
    EnterLong(1, 1, "Long Beta");
    }

    "

    I however noticed that on some occasions the execution only takes place on the first instrument (ES 09-17). And does not execute on the second instrument.

    Not sure if the reason for this is any market data missing, but I tried to add

    if (BarsInProgress == 0 & BarsInProgress == 1)
    {

    [All STRATEGY CODE]

    }


    but when I added it nothing ever was executed as if the strategy didnt run at all.

    When I remove that code, executions are made, but sometimes not simultaneous/symmetrical (e.g. only the ES 09-17 gets executed).

    Please help!

    #2
    Hello nikolaalx,

    I suspect that the reason it doesn't take another trade is because of your EntriesPerDirection and Entry handling settings, which you can read about at the following links,





    If you set EntryHandling = EntryHandling.AllEntries, do you see entries on both instruments?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    49 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    141 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
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X