Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest is not respecting my realtime entry levels

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

    Backtest is not respecting my realtime entry levels

    Hello NT Team,

    Im using Calculate OnClose, so basically without the need to 1 tick data series, candles already can operate on OHLC without any problem

    and I understood from your doc that while using OnClose the candle 0 is the candle that just closed and not the candle that is currently forming, that's EXACTLY what i base my entry on and it operates perfectly on playback, but when i put it to work on backtest or on realtime live account, it gives me some straaange entry levels.

    my strategy is trading candle colors change breakouts, plz check the attached image

    here is the code i use to verify that i have a potential bullish entry

    Code:
    if (Open[1] > Close[1] && Close[0] > Open[0] && Close[0] > High[1])
    Thanks
    Attached Files

    #2
    Hello MohammedAmine,

    Just fyi, 1-tick intra-bar granularity would still be necessary for accurate order fills with limit and stop orders.

    Are you stating the conditions are evaluating differently?

    If so, write to file all of the values used in the condition and run this in playback then backtest.

    Include both files with your next post so that I can compare.

    Below is a link to a forum post with a video and example script that demonstrates.
    Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Thanks for your reply, but actually it is just extra work for me without solving any problem, I have different results between playback and backtest and realtime, this is a fact not something to prove by writing price levels on a file.

      now the question is why is it happening ? is it a must to add 1 tick data series even im not using intra bar data ? or the bars indexing is different between backtest and playback and realtime

      there is a cause to this, i need to know causes and solutions to these causes,

      Thank you

      Comment


        #4
        Hello MohammedAmine,

        This gives us information about what is different.

        If the data is the same and the code is the same, the results would be the same.

        Printing the data and conditions tells us what changed and what to investigate.

        Unfortunately, I cannot say why this is happening as I do not have enough information.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        43 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X