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

What bar does order execute?

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

    What bar does order execute?

    I have a strategy with two symbols. Each uses a 1m timeframe. So, each bar prints at the same time. On which bar should I see the order executed? It appears the order is getting placed two bars after the diamond is drawn. Shouldn't it be placed one bar after? Isn't the order like saying, "place order next bar at market?"

    Code summary. The actual code is much longer.

    if (BarsInProgress == 0)
    {
    placeLong = true;
    DrawDiamond(....);
    }

    if (BarsInProgress == 1 && placeLong)
    {
    EnterLong();
    }

    Thanks,

    Folls

    #2
    During backtest, the order will be filled (if fillable) on the bar after the Enter() method is called. To verify, add a Print(Time[0]) statement when you call EnterLong().

    In real-time, the order is submitted when the method is called and it will be plotted when it is actually filled based on the time stamp of the execution.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    10 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    2 views
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X