Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to read time period of data series?

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

    How to read time period of data series?

    Hi,

    I am developing a strategy for automated execution.

    I want the strategy to work in multiple time frames, using different logic. So how do I dynamically read the time period of a data series into ninjascript, so I can execute different code blocks.

    I am referring to the primary data series, as the periodicity of the Add'ed data series are known.

    #2
    Hello,
    Thank you for your post.
    You can check the primary dataseries period type and value by checking the BarsPeriod.
    For example if I wanted to check if the primary data series is a 5 minute bar I would do the following :

    protected override void OnBarUpdate()
    {
    if(BarsPeriod.Id == PeriodType.Minute && BarsPeriod.Value == 5)
    //Do Something
    }

    For more information on the BarsPeriod property please see the following link: http://ninjatrader.com/support/helpG...barsperiod.htm

    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thank you, Cody. That is exactly what I needed

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      6 responses
      31 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X