Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LinReg on multiple data series in a Strategy

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

    LinReg on multiple data series in a Strategy

    The default (0 index) time frame of the strategy from the UI is 1 tick.

    I've added the another time frame to the Initialize section of a Strategy.

    Add(PeriodType.Minute, 1)

    I want to find the LinReg(60) of the most recent bar from the 1 minute time series.

    In theory, it would be something like the following:

    LinReg(60)[0][1]

    But that doesn't work. Is there a way to do this?
    Last edited by aaaa1982; 06-29-2015, 09:21 PM.

    #2
    Hello aaaa1982,

    Thank you for your inquiry.

    When you call the LinReg indicator method, you will notice that it has two overloads that you can use. What you would like to use is the
    Code:
    LinReg(IDataSeries input, int period);
    overload.

    In order to access your minute data series, you would need to use BarsArray, with an index of 1, to put in the IDataSeries parameter field. So, you would call the method like so:
    Code:
    LinReg(BarsArray[1], 60)[0];
    You can read more about BarsArray in the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...?barsarray.htm

    You can read more about Multi-Time Frame & Instruments in the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...nstruments.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,610 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    6 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    16 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X