Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

get current periodtype and period

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

    get current periodtype and period

    Hello,

    I need to ask you something..
    I would like to create new strategy and in the Initialize() add another chart but with the same timeframe as the default chart..

    you know what I mean...
    you will run my strategy on EURUSD Minute-30 timeframe.
    And my strategy have to count some data from GBPUSD chart with the same timeframe as the default, so in this example it means Minute-30 timeframe.

    So how can I get PeriodType instance of the current default timeframe where the stratedy is running? And also the "period" integer?

    Thank you

    #2
    Hello Zooinek,

    Thank you for your post.

    Unfortunately you will have to hard code this. There is no way to dynamically change the period or interval type used. The properties you would need to use can't be accessed from within the Initialize() method.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X