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

Testing Intra Bar

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

    Testing Intra Bar

    Can NT8 back test intra bar using tick data? Like buy as the high of the previous is broken and vice versa. Looks like the Wizard is plotting trades only after the close of a bar. Like I am supposed to download tick data or something else before back testing?
    Thanks.

    #2
    Hello,

    When using backtesting the strategy will run exactly the same as if CalculateOnBarClose is set to true. This is true whenever the strategy runs on historical type data. The reason for this is because the only info known historically is the Bar open, High, Low and close and not all of the ticks that make up the bar. You can also get extremely misleading results if you are using a bar that changes shape such as renko bar type as the finished bar does not show the true range of price movement.

    Please see Discrepancies: Real-Time vs Backtest section of our helpguide.


    Adding a secondary data series of a smaller time duration would allow your strategy to enter/exit intra bar and give you results closer to market replay.

    Please see Backtesting NinjaScript Strategies with an intrabar granularity for a reference example on how you’d set this up.
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      So I can say add down to a 1 minute data series I assume as the lowest time frame to test a 5 min. or 15 min. chart or higher. Correct? So there is no way to back test using a tick chart in NT 8?
      Thank you.

      Comment


        #4
        So how do I add say a 1 minute series of the same instrument to back test in NT8?
        Thank you.

        Comment


          #5
          Hello Trader17,

          The sample I provided, Backtesting NinjaScript Strategies with an intrabar granularity, demonstrates how to add a secondary data series of type tick.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Got it. I can add a data series directly from within the Builder it seems. And I can make the strategy refer to it while back testing? So say I am testing on the 30 min. chart with a 1 min. data series it will show trades intra bar on the 30 min. time frame?

            Thanks.

            Comment


              #7
              Hello Trader17,

              At the moment the strategy builder does not allow you to specify a bars index for orders to be submitted to nor use BarsInProgress, so this would not be possible in the builder however I will add your vote to feature request, SFT-2400.

              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              13 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by alifarahani, Today, 09:40 AM
              5 responses
              23 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X