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 charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                61 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                149 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                162 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 05-10-2026, 08:12 PM
                0 responses
                99 views
                0 likes
                Last Post CarlTrading  
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                286 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Working...
                X