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 DannyP96, 05-18-2026, 02:38 PM
            1 response
            27 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            117 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            69 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            226 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            414 views
            0 likes
            Last Post CaptainJack  
            Working...
            X