Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Zero - trade real-time strategies that actually should be creating plenty of trades

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

    Zero - trade real-time strategies that actually should be creating plenty of trades

    I have several strategies that seem to work well historically, but when backtested over the past few weeks it produces hugely negative results compared to when backtested for 1/1/2022 through about 6/17/2023.

    Also, when activated as a strategy on a simulated account, these strategies (which appear to create plenty of trades when backtested) create zero trades.

    These strategies are simple strategies and their daily activity is not date specific. Also, essentially they are scalping algorithms - in other words, the opportunities to scalp did not drastically change starting around mid June of this year.

    Can you help me sort this out?

    Attached are screen shots that are intended to illustrate the problem.

    Best regards,
    Dan
    Dan ​

    #2
    Hello drsclaud23,

    Thank you for your post.

    Please review the help guide page on the differences on real-time vs backtest.

    https://ninjatrader.com/support/help...ime_vs_bac.htm

    A strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest.

    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.


    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

    Additional information may be found in this forum post:

    https://forum.ninjatrader.com/forum/...377#post773377

    Please let us know if we may be of further assistance.

    Comment


      #3
      Hi Gaby,
      Thanks for your reponse.

      As far as I can tell (and I am no expert), your response does not appear to apply to this situation.

      Firstly, I use calculate OnBarClose, so intrabar variations shouldn't be relevant to this problem.

      Secondly, the strategy appears to work nicely for 1/1/22 - 6/16/23 (more or less, on the second date) and then, even though the strategy is not date dependent, it starts puking on or around 6/17/23. Do intrabar issues have relevance here?

      Sorry if I am missing something here,
      Dan

      Comment


        #4
        Hello,

        The 1-tick series would be used for accurate fills.

        To further analyze why your strategy is not submitting orders at the expected time, debug the script by adding prints or writing to a file.

        In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

        Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.

        https://ninjatrader.com/support/foru...121#post791121

        Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

        Let me know if you need any assistance creating a print or enabling TraceOrders.

        Save the output from the output window to a text file and provide this with your reply.

        I'll be happy to assist with analyzing the output.

        Comment


          #5
          Gaby,
          Thanks for your advice. I watched the video regarding adding Prints, which made sense. However, when I looked at the strategy once more before adding prints, I realized that the strategy was using NQ 06-23 and ES 06-23 which worked in the Strategy Analzyer only through the end of the 06-23 contract.

          Changing the inputs to NQ 12-23 and ES 12-23 fixed this problem.

          I'm writing this for the benefit of anyone else who might come across this issue. I'm not sure why the contracts contained in the strategy didn't automatically roll over.

          Best regards,
          Dan

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          31 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
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 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