Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

using tick data(intrabar granularity) in strategy analyer

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

    using tick data(intrabar granularity) in strategy analyer

    Hi,
    I have been creating anf testing strategy without major issues for sometime now.

    My current strategy needs to be intrabar and I find that when optimizing using strategy analyzer, the strategy basically only calculate on bar close. Is there any way to enable it to submit order before closing current bar. Please note the strategy works fine i.e as intended using market replay or when live. It will nice to backtest/optimize on the same principles before going live.

    I will give an example...

    I won't to go Long if the current ask goes above the close of the previous H1 bar. I cannot do this for backtesting or optimizing.

    Please help!
    regards

    #2
    Hello SuperDriveGuy,

    Yes, please set 'Calculate on bar close' to False for the strategy used in the Strategy Analyzer.

    Comment


      #3
      Hi Jason,

      I can't find that option. Please see attached screenshot.

      Regards
      Attached Files

      Comment


        #4
        My apologies, I was not that clear. You will need to add it in the code of the strategy.

        Comment


          #5
          Hi Jason,
          I already have that in my strategy...

          protected override void Initialize()
          {
          SetProfitTarget("", CalculationMode.Ticks, ProfitTarget);
          SetStopLoss("", CalculationMode.Ticks, StopLoss, false);
          TraceOrders = true;
          CalculateOnBarClose = false;
          }
          regards

          Comment


            #6
            To clarify, when backtesting/optimizing/etc. your strategy will always be processed as if CalculateOnBarClose = true. Only in real-time can you get intrabar processing.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi Jason,
              I have another thread open with Whitmark, and he is suggesting using a primary H1 and a secondary M1 etc data series to achieve intrabar order optimization, unless there is another workaround or hidden feature??

              Will NT7 enable me to do what I want?
              Regards

              Comment


                #8
                NT7 will not provide intrabar backtesting. Whitmark's suggestion is the one you want to follow. You can find a reference sample in the Reference Sample section demonstrating this.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Josh and Jason!

                  Comment


                    #10
                    Hi Guys,
                    Just a thought currently I have market replay recorded a day at a time, can I record for multiple days.

                    My aim being to capture market replay information for say 30 days and then instead of backtesting/optmizing against historic data, I can replay against the 30 days replay data recorded earlier. I will have to do manual iterations but I am having a hard time, doing the intrabar order placement and strategy definition.

                    TIA

                    Comment


                      #11
                      Currently you cannot continuously roll 30 days worth of replay tape. They will be broken up into individual days.
                      Josh P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      114 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      61 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      40 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      43 views
                      0 likes
                      Last Post TheRealMorford  
                      Started by Mindset, 02-28-2026, 06:16 AM
                      0 responses
                      82 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X