Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New session template

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

    New session template

    Hello guys
    im trying to backtest my strategies that run from 9:30am to 12pm. The problem I have is when I backtest for 5 day. The indicator calculate 9:30 to 12pm monday then 12pm monday to 9:30am Tuesday and on and on. I hope you guys understand my question.

    #2
    Hello SuperDude123,

    Controlling the time range a strategy can place orders can be done with Time conditions.

    Below is a link to the help guide reference sample.
    https://ninjatrader.com/support/help...to_limit_t.htm

    And a link to the Strategy Builder 301 training video.
    https://www.youtube.com/watch?v=VxU4...XkWe0Nf&t=2529

    Controlling the data that appears and can be used for calculations in NinjaScripts can be done with a custom Trading hours template.
    https://ninjatrader.com/support/help...ngHourTemplate
    Last edited by NinjaTrader_ChelseaB; 08-30-2021, 07:11 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for reply., I did set all that up but my problem with it is, it calculate hour that I set up to like Monday 9am to 12pm then the indicators will count Monday 9 to 12 then 9 to 12 Tuesday and Wednesday 9 to 12. And it connects those timeframe together which will give you wrong indicator and ending up buying or selling at the wrong time. It need to be running on current time and the missing hours that you didn't put in.

      Comment


        #4
        Hello SuperDude123,

        I'm not certain that I understand. Are you using the <use instrument settings> for the Trading hours and using time conditions in the code of the script?

        Or have you modified the data with a custom trading hours template?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes I did set up the trading hour with new template. But when you chop up timeframes like 9am to 4pm next day indicator will count from 4pm yesterday and missing the over night indicator which will give you wrong info.

          Comment


            #6
            Hello SuperDude123,

            This is expected. The TradingHours controls the data that can be used for processing and that appears on the chart.

            If you do not want to change the data, do not change the trading hours. Use <use instrument settings> if you want the full data.

            Instead use time conditions in the code to trigger actions between time ranges.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              So how do I get real back testing if it give me wrong info. Basically, I want to know how did I do between 930am to 4pm. Monday to Friday. But it won't give me true indicator when the hours of night time are not factor in.

              Comment


                #8
                Hello SuperDude123,

                By using the Trading hours of the exchange and using time conditions in the script. Have a look at the examples and video I have provided you.

                The <use instrument settings> are the hours of the exchange.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                566 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                330 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                547 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                548 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X