Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Which order type is most realistic?

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

    Which order type is most realistic?

    Hey guys I was just curious to know which order setup I should use to be most realistic in backtesting.

    I have a strategy that is written so that the orders are submitted on the first tick of a minute bar the entries are actually submitted using a stop entry market order, like this:

    CalculateOnBarClose = false;
    Unmanaged = true;
    PlaceMMExitOnEntry = true;

    EnterLongStop(1, EntryTarget); - This is submitted on first tick of minute bar

    I have the same strategy where CalculateOnBarsClose=true so im assuming it submits orders on the bar close, with for example exitShortSignal = ExitShort(1, "exitShortSignal", "enterShort") This strategy takes a signal from the same minute series as above and submits a market order for ES once the signal price is reached.

    What I have noticed is that the second strategy setup shows backtest as being 1 tick behind the other strategy setup above it.

    I would like to know, which one is the most realistic in backtesting? Which one would be better to use in real-time trading?

    Thanks,
    EliteTraderNYC

    #2
    If you'd like, you can always review the Fill() logic for any order types by going to Documents\NinjaTrader 7\bin\Custom\Type\ and the fill logic is in the @DefaultFillType.cs

    In there you will find the exact logic used when you use the default fills and there are some comments that help explain how each order will behave.

    As far as what is more realistic is a matter of opinion, and we will keep this thread open for other users to share their opinions and experience, but as a reminder you may feel free to modify and develop your own fill type with your own logic.

    MatthewNinjaTrader Product Management

    Comment


      #3
      As a follow up, lets say you just have minute bars in a strategy, would the actual fill price in a backtest be just an approximation of the possible exit/entry price? given that there is no realtime price info other than the minute data? Assuming calculateonbarclose=False?

      Comment


        #4
        Assuming you're using the default fill type, It would depend on the order type that is used in the strategy.

        A Market Order would be the Next high / low / next open (depending on buy vs sell) +/- any slippage points you configured.

        A limit order fills at the limit price once price has traded through it.

        Stop markets/Stop Limits fill using similar logic but will wait until price has traded at the stop price.

        This is evaluated at the end of each bar as there is no real-time data, however keep in mind that backtesting is always done COBC = True.

        If you need more granularity in your backtests, you can always program in a higher resolution such as a 1 second or 1 tick data following our reference sample:

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        566 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X