Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Discrepancy between strategy builder and market trading

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

    Discrepancy between strategy builder and market trading

    Hello dear community
    I am a brand new ninja and have a general question:
    I have a strategy that works quite well in the analyzer when trading but then always runs into the stop loss. I have attached an example.
    Now my question is, where do I have to start looking? or by which parameters can I see where the difference lies? I have read here in the forum that historical data always runs with "Calculate" on bar close, but the strategy can be set differently. I have checked this point.
    Can you give me a few tips here? please bear in mind that I am a newbie

    Many thanks in advance​
    Attached Files

    #2
    Hello Bundner,

    Thanks for your post.

    To clarify, are you backtesting the script using the Strategy Analyzer window?

    I see you are using a custom Renko barstype from a third-party developer for your testing.

    Standard Renko bars can be challenging for backtesting as the barstypes use functionality to remove the last bar in the data series and replace the bar with a new Open price.This is done with reversals and cannot be simulated historically, because the bars are already built. Testing may be done with the Playback Connection to fully simulate standard Renko bars with accurate reversals and order fills.

    Playback: https://ninjatrader.com/support/help...connection.htm

    Some custom Renko bars aim to work around this limitation and often substitute a "fake" open price in the bar. This will result in Standard Order Fill Resolution estimating fill prices using OHLC values that are not 100% reflective of actual price action which can create discrepancies with results. High Order Fill Resolution should be used in cases like this, or the strategy should be written to submit orders to a single tick data series.

    Please review the help guide document on the differences on real-time vs backtest (historical). The information above is noted on this help guide page.
    https://ninjatrader.com/support/help...ime_vs_bac.htm

    In regard to writing the strategy to submit orders to a single tick data series, see the help guide documentation and reference sample below.

    SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/helpGuides/nt8/backtesting_ninjascript_strate.htm

    TickReplay — https://ninjatrader.com/support/help...ick_replay.htm

    Developing for Tick Replay -
    https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay

    Additional information may be found in this NinjaTrader Forum post —
    https://ninjatrader.com/support/forum/forum/ninjatrader-8/strategy-development/100192-comparing-real-time-historical-and-replay-performance?t=102504

    ​​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    557 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 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
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X