Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Reading a strategy's data series type and value

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

    Reading a strategy's data series type and value

    In my backtesting I have a strategy with a higher time frame added. I want that higher time frame to be 5x the primary time frame. So if I'm backtesting on 5min bars then I want my higher time frame to use 5*5 = 25min bars.

    How does my strategy programatically determine the period type and value of the primary bars array? Would it be

    PHP Code:
    BarsArray[0].Period.Value 
    ???

    If so, then I would put this in my Initialize() method

    PHP Code:
    Add(PeriodType.MinuteBarsArray[0].Period.Value); 
    That would seem to work, but I get a "BarsArray can not be accessed in the Initialize() method" error when I try to do that.

    What other way is there?
    Last edited by shodson; 06-01-2010, 01:57 PM.

    #2
    Hello shodson,

    Unfortunately this is not supported. Series must be added in the Initialize method and BarsPeriod.Value is not accessible from this method. You will have to hard-code all series to be added.
    Last edited by NinjaTrader_RyanM1; 06-01-2010, 02:14 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK thanks, I just added it as a parameter of my strategy, no worries. Not what I wanted but it'll work.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Austiner87, Today, 03:42 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by cshox, Today, 11:11 AM
      2 responses
      14 views
      0 likes
      Last Post cshox
      by cshox
       
      Started by algospoke, Today, 06:53 PM
      0 responses
      5 views
      0 likes
      Last Post algospoke  
      Started by mlprice12, 12-21-2021, 04:55 PM
      3 responses
      293 views
      0 likes
      Last Post paypachaysa  
      Started by lorem, 04-25-2024, 09:18 AM
      20 responses
      85 views
      0 likes
      Last Post lorem
      by lorem
       
      Working...
      X