Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BasePeriodType

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

    BasePeriodType

    Under which class is "BasePeriodType" located? I'm trying to implement the following code:

    Code:
                    switch (BasePeriodType)
                    {
                        case "Tick":
                            Add(PeriodType.Tick, BarsPeriod.Value * this.HigherTimeframeMultiple);
                            break;
                        case "Minute":
                            Add(PeriodType.Minute, BarsPeriod.Value * this.HigherTimeframeMultiple);
                            break;
                    }

    #2
    NM, found it under "BarsPeriod".

    Comment


      #3
      To the Support Staff

      Actually, I do have a couple questions for you guys:

      According to the help file, the "BarsPeriod" is only relevant for "Kagi, Line Break, P&F, and Renko Bars."

      It also states that the property should not be accessed within the initialize() method.

      The question is, what happens when it's accessed within initialize(), and why is this sort of thing only relevant for those 4 types of bars?

      Thanks,
      CG

      Comment


        #4
        Hi cgeorgan,

        The BarsPeriod array is created in real time, so attempting to access it before bars are built cannot be done.

        With NT7, the BasePeriodType is only available and supported for those listed at - http://www.ninjatrader.com/support/h...barsperiod.htm

        Other bar types and custom bar types are are not relevant here because of the way they are calculated ad built.
        TimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Tim View Post
          Hi cgeorgan,

          The BarsPeriod array is created in real time, so attempting to access it before bars are built cannot be done.

          With NT7, the BasePeriodType is only available and supported for those listed at - http://www.ninjatrader.com/support/h...barsperiod.htm

          Other bar types and custom bar types are are not relevant here because of the way they are calculated ad built.
          I have been able to call BasePeriodType on initialization; though I've noticed all I get is "minute". It does not throw an exception - would it cause problems later in the operation of any strategy?

          Comment


            #6
            Hi cgeorgan,

            BarsPeriod should NOT be used in Initialize(). Yes, it could cause issues later.
            TimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            39 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            18 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            25 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            41 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            34 views
            0 likes
            Last Post CarlTrading  
            Working...
            X