Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Joining bars

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

    Joining bars

    Hello!

    The instrument I use for backtesting traded in two stages intraday session(with high trading volume) and evening session with much lower trading volume.

    So I have an issue: indicator's values for evening session evaluating over bars from intraday session and first bar of every intraday session is evaluated over bars of previous evening session.

    I want to avoid this in the following way: join all bars from evening session into single bar of timeframe I use for backtesting.

    Can I do it by using NinjaTrader?

    #2
    Hello aks19,

    Thanks for your post.

    I am not quite certain what you are trying to achieve.

    Does your session template have two periods in each day and you are trying to make one daily bar out of this?

    This will not be possible as the session close forces a new bar to be created.

    Can you clarify the bar type and the current times of the bars you are trying to merge together?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello aks19,

      Thanks for your post.

      I am not quite certain what you are trying to achieve.

      Does your session template have two periods in each day and you are trying to make one daily bar out of this?

      This will not be possible as the session close forces a new bar to be created.

      Can you clarify the bar type and the current times of the bars you are trying to merge together?
      Hello, NinjaTrader_ChelseaB!

      Look at example below:
      1. I have 1 min historical data for instrument.
      2. There are two trading sessions: from 10:00-18:45 and from 19:00-23:50.
      3. Suppose I want to perform some backtesting using 2h timeframe

      I want NT to group 1min bars in the following way for each day: 10:00 -12:00, 12:00-14:00, 14:00-16:00, 16:00-18:45, 19:00-23:50.

      Comment


        #4
        Hello aks19,

        If you have two sessions defined on a single day, it will not be possible to make one bar out of this.

        A new bar will form at the session break. It is not possible to change this.

        Instead, you will need to make one large session.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello aks19,

          If you have two sessions defined on a single day, it will not be possible to make one bar out of this.

          A new bar will form at the session break. It is not possible to change this.

          Instead, you will need to make one large session.
          I use Default 24/7 template.

          But my question is not concerning about it. I try to explain in another way.
          1. I have historical data in 1min bar format.
          2. There are two trading sessions during calendar day: from 10:00-18:45 and from 19:00-23:50.

          There are reasons to group 1min bars of each calendar day for backtesting in the following way:
          1. First bar: 1 min bars from 10:00-12:00
          2. Second bar: 1 min bars from 12:00-14:00
          3. Third bar: 1 min bars from 14:00-16:00
          4. Fourth bar: 1 min bars from 16:00-18:00
          5. Fifth bar: 1 min bars from 18:00-18:45 and from 19:00-23:50

          I.e. there are 1min bars representing trading sessions during the same calendar day and I want to group them using some custom rules and run backtesting.

          Can you advice me how can I do it using NinjaTrader?

          Comment


            #6
            Hi aks19,

            You would need to create a custom bar type for this.

            Custom bar types are not supported for NinjaTrader 7 so I may not assist with this.

            However take a look at the UniRenko bar type. This shows how to make a custom bar type and select a slot (this one uses PeriodType.Custom5 as its slot).
            http://www.ninjatrader.com/support/f...php?linkid=560
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by aks19 View Post
              Hello, NinjaTrader_ChelseaB!

              Look at example below:
              1. I have 1 min historical data for instrument.
              2. There are two trading sessions: from 10:00-18:45 and from 19:00-23:50.
              3. Suppose I want to perform some backtesting using 2h timeframe

              I want NT to group 1min bars in the following way for each day: 10:00 -12:00, 12:00-14:00, 14:00-16:00, 16:00-18:45, 19:00-23:50.
              If you want to backtest on a 2hr time frame, you change your time frame to 120 minutes. The alternative is to write a multi-timeframe script, if you want to have both the 1 minute and 2 hour time frames available.

              Comment


                #8
                Originally posted by NinjaTrader_ChelseaB View Post
                Hi aks19,

                You would need to create a custom bar type for this.

                Custom bar types are not supported for NinjaTrader 7 so I may not assist with this.

                However take a look at the UniRenko bar type. This shows how to make a custom bar type and select a slot (this one uses PeriodType.Custom5 as its slot).
                http://www.ninjatrader.com/support/f...php?linkid=560
                Thank you!

                Comment


                  #9
                  Originally posted by koganam View Post
                  If you want to backtest on a 2hr time frame, you change your time frame to 120 minutes. The alternative is to write a multi-timeframe script, if you want to have both the 1 minute and 2 hour time frames available.
                  Yes, I know. At this time I do in this way. But I need a way to do I explained earlier.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by kevinenergy, 02-17-2023, 12:42 PM
                  118 responses
                  2,777 views
                  1 like
                  Last Post kevinenergy  
                  Started by briansaul, Today, 05:31 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post briansaul  
                  Started by fwendolynlpxz, Today, 05:19 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post fwendolynlpxz  
                  Started by traderqz, Yesterday, 12:06 AM
                  11 responses
                  28 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by PaulMohn, Today, 03:49 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post PaulMohn  
                  Working...
                  X