Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve PeriodType

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

    Retrieve PeriodType

    How do I programmatically get the PeriodType of the current chart for use within Initialize()?

    Thanks,
    Mike
    Last edited by Mike Winfrey; 03-14-2010, 09:24 AM. Reason: More information

    #2
    Hello,

    I don't think you can. No bars are available in the Initialization() block.

    This is how you check bar types though:

    if
    (Bars.Period.Id == PeriodType.Tick )
    {
    // Indicator calculation logic here
    }


    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks Ben

      Comment


        #4
        This may not change your answer but thought I'd be more specific just in case.

        In the Initialize() method I have

        Add("$GBPUSD", periodtype, timeframe);

        Currently, I set periodtype by means of a parameter and actually use PeriodType.Minute. However, I'd like to be able to get the interval setting that is used when opening a new chart and set my periodtype variable based on the chart interval setting instead of through the static parameter.

        I hope I'm expressing this well enough.

        Thanks again,
        Mike

        Comment


          #5
          Mike, thanks for clarifying - accessing this property dynamically is unfortunately not supported.

          Comment


            #6
            Well shucks...thanks Bertrand

            Comment


              #7
              Did you find any way to do it ?

              Originally posted by Mike Winfrey View Post
              Well shucks...thanks Bertrand
              Also , see my new thread :

              Comment


                #8
                No I didn't and gave up.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                630 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                566 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X