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 CarlTrading, 03-31-2026, 09:41 PM
                      1 response
                      68 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by CarlTrading, 04-01-2026, 02:41 AM
                      0 responses
                      39 views
                      0 likes
                      Last Post CarlTrading  
                      Started by CaptainJack, 03-31-2026, 11:44 PM
                      0 responses
                      63 views
                      1 like
                      Last Post CaptainJack  
                      Started by CarlTrading, 03-30-2026, 11:51 AM
                      0 responses
                      62 views
                      0 likes
                      Last Post CarlTrading  
                      Started by CarlTrading, 03-30-2026, 11:48 AM
                      0 responses
                      53 views
                      0 likes
                      Last Post CarlTrading  
                      Working...
                      X