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

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

    ​​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X