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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    71 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    43 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    25 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    28 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    56 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X