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 SalmaTrader, 07-07-2026, 10:26 PM
                  0 responses
                  50 views
                  0 likes
                  Last Post SalmaTrader  
                  Started by CarlTrading, 07-05-2026, 01:16 PM
                  0 responses
                  22 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CaptainJack, 06-17-2026, 10:32 AM
                  0 responses
                  16 views
                  0 likes
                  Last Post CaptainJack  
                  Started by kinfxhk, 06-17-2026, 04:15 AM
                  0 responses
                  22 views
                  0 likes
                  Last Post kinfxhk
                  by kinfxhk
                   
                  Started by kinfxhk, 06-17-2026, 04:06 AM
                  0 responses
                  23 views
                  0 likes
                  Last Post kinfxhk
                  by kinfxhk
                   
                  Working...
                  X