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 Tim-c, Today, 03:54 AM
    0 responses
    3 views
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    2 views
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,772 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    31 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    945 views
    0 likes
    Last Post spwizard  
    Working...
    X