Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer / Optimizer Not Running On Custom Built Strategy

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

    Strategy Analyzer / Optimizer Not Running On Custom Built Strategy

    Hi there, very new to NT8 so please bear with me.

    NT8: 8.1.1.7 64-bit
    Using Ninjatrader 8 for free and my 14 day free trial ended a few days ago and have been using market playback to paper trade. Currently I do not have any live data feeds at the moment.

    I build a custom strategy in the strategy builder that calculates on each tick. Pretty much it looks at the delta rate and delta change% on a tick by tick basis. Additional data I pull in is NQ SEPT23 tick values (under additional data).

    The strategy runs perfectly fine when I do a market play back, it enters and exits trades exactly how it was build.

    But when I try to use the Strategy Analyzer / Optimizer and run no numbers return, just zeros. Even when I check the box under "Data Series" called tick replay and run no results return.

    But when I select the "Sample MA crossover" The strategy analyzer runs fine and returns numbers.

    When I go to properties -> General -> and check "Use local data only" for historical market data (Aug 2023) I have it still doesn't run.

    My initial thoughts was because I don't have a live connection feed to any data providers, but the sample MA crossover runs fine and also it says under docs that you can use local data only.

    Any ideas?

    Thank you



    Attached Files

    #2
    Hello restacks,

    Thanks for your post.

    To run a backtest on historical data in the Strategy Analyzer, you would need to have access to historical data for the instrument you are using.

    If you expand the dates in the Historical Data window, do you see that you have historical tick data downloaded?

    Note from the Strategy Analyzer help guide:

    "A backtest allows you to analyze the historical performance of a strategy. In order to run a backtest you will need:Strategy Analyzer Backtesting: https://ninjatrader.com/support/help...a_strategy.htm

    Do you see any error messages in the Log tab of the Control Center when running a backtest on the strategy? If so, what exactly does the error report?

    To clarify, if you test the SampleMACrossover strategy on the same data do you see results reported?


    <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


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello restacks,

      Thanks for your post.

      To run a backtest on historical data in the Strategy Analyzer, you would need to have access to historical data for the instrument you are using.

      If you expand the dates in the Historical Data window, do you see that you have historical tick data downloaded?

      Note from the Strategy Analyzer help guide:

      "A backtest allows you to analyze the historical performance of a strategy. In order to run a backtest you will need:Strategy Analyzer Backtesting: https://ninjatrader.com/support/help...a_strategy.htm

      Do you see any error messages in the Log tab of the Control Center when running a backtest on the strategy? If so, what exactly does the error report?

      To clarify, if you test the SampleMACrossover strategy on the same data do you see results reported?


      Ah, I do not have access to any data provider at the moment. I am wondering if that is the problem?

      I have market playback data for the dates (July 17 - July 21). I'm guessing this is different from downloaded historical tick data? Therefore the strategy analyzer wont run on market replay data?

      The thing is though the SampleMACrossover strategy runs fine and returns results in the box.

      Also when I run the strategy analyzer on my strategy, no logs return.

      Comment


        #4
        Hello restacks,

        Thanks for your notes.

        Market Replay data is not the same as Historical data. Market Replay data is used for the Playback connection.

        The Strategy Analyzer requires that you have access to Historical data to run backtests in the Market Analyzer. You could connect to the Simulation data feed connection and then download Historical data in the Tools > Historical Data window for the instrument and dates you want to backtest. From the Strategy Analyzer help guide page:

        "A backtest allows you to analyze the historical performance of a strategy. In order to run a backtest you will need:Backtesting in Strategy Analyzer: https://ninjatrader.com/support/help...a_strategy.htm
        Downloading Historical Data: https://ninjatrader.com/support/help...8/download.htm

        You should check the Log tab of the Control Center for any error messages that might appear when running the strategy. Also, you should add debugging prints to your strategy to understand how it is behaving and placing orders. Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121

        I see you noted that you are using Calculate.OnEachTick in your strategy. Please review the help guide document on the differences on real-time vs backtest (historical).
        http://ninjatrader.com/support/helpG...ime_vs_bac.htm

        When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

        Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.

        Below is a link to the help guide on Calculate.
        https://ninjatrader.com/support/help.../calculate.htm

        To improve the accuracy of a backtest, you may use Tick Replay along with an added 1-tick series to have logic processed intra-bar and have orders filled intrabar. Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data, but this does not allow for intra-bar order fills. You would need to add a single tick data series and submit orders to that single tick data series for a strategy that uses Tick Replay.

        High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.

        Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.

        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 NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 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