Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    31 views
    0 likes
    Last Post love2code2trade  
    Started by cls71, Today, 04:45 AM
    2 responses
    10 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by proptrade13, Today, 11:06 AM
    0 responses
    5 views
    0 likes
    Last Post proptrade13  
    Started by kulwinder73, Today, 10:31 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by RookieTrader, Today, 09:37 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X