Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Knowing dataseries type in code

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

    Knowing dataseries type in code

    Hello

    How can I in the code find out whether the current instrument runs with daily or weekly bars? (=data series type)

    thanks, regards

    #2
    Hello,

    Please see this documentation:

    BrettNinjaTrader Product Management

    Comment


      #3
      hi

      I have done this before, but when using BarsPeriod.BasePeriodType I get always "Minute", even when my settigns are day or week. I do not check in Initialize function.

      thanks, regards

      Comment


        #4
        Hello,

        Thanks for the note.

        I just did a quick test and it worked on my side.

        What code snippet are you using so I can do an exact comparison?

        Also how are you making the comparison?

        Finally are you doing multi time frame?

        -Brett
        BrettNinjaTrader Product Management

        Comment


          #5
          Originally posted by Beauregard View Post
          hi

          I have done this before, but when using BarsPeriod.BasePeriodType I get always "Minute", even when my settigns are day or week. I do not check in Initialize function.

          thanks, regards
          On what kind of Bars object are you using BasePeriodType?

          Comment


            #6
            Hello

            I use this code:

            if (BarsPeriod.BasePeriodType ==PeriodType.Day)

            I run my strategies only either in Day-Type or Weekly-Type. No multitimeframe strategies.

            thanks

            Comment


              #7
              Originally posted by Beauregard View Post
              Hello

              I use this code:

              if (BarsPeriod.BasePeriodType ==PeriodType.Day)

              I run my strategies only either in Day-Type or Weekly-Type. No multitimeframe strategies.

              thanks
              It looks like you are using the wrong property. Correct would be:

              Code:
              if (BarsPeriod.Id ==PeriodType.Day)
              BarsPeriod.BasePeriodType, as the documentation states is "Only relevant for Kagi, LineBreak, PointAndFigure, and Renko Bars objects. ..."

              Comment


                #8
                Thanks Koganam.
                BrettNinjaTrader Product Management

                Comment


                  #9
                  great, thanks, this worked

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  650 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  574 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  577 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X