Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to access daily data series from an indicator running on intraday charts?

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

    How to access daily data series from an indicator running on intraday charts?

    Hello,

    Could you help me on how to access daily data series from an indicator running on intraday charts?
    The Add() function only works in strategies not indicators.


    By modifying the pivot indicator source code I came up with the following code, which seems working to
    some extend. However I am not quite understand how the Data class and Bars class are defined, thus
    I donot quite understand the following code. the dailyBars supposely should be from 40 calendar day ago to present, but why is the oldest daily bar is of less index so that I have to use dailyBars.Get(dailyBars.Count-1) to access
    the last daily bar? Also where are Bars.From and Bars.To defined? Where can I find more information about these classes?


    What is the best way to convert the function getValue() and getValueAbsolute() in eSignal EFS APIs into NinjaScript,
    especially when accessing the data of other time frame and/or symbol? For example,

    var C = getValueAbsolute("Close", 0, -8, "ES M8,D")
    creates an eight element array, in which C[0] is the most recent daily close price of "ES M8" and C[7] is the daily
    close price seven days ago.


    protected override void OnBarUpdate()
    {
    if ( ! isDailyDataLoaded && ! isInitializing )
    {
    isInitializing = true;
    dailyBars = Data.Bars.GetBars(Bars.Instrument, new Period(PeriodType.Day, 1), Bars.To.AddDays(-40), Bars.To, (Session) Bars.Session.Clone(), Data.Bars.SplitAdjust, Data.Bars.DividendAdjust);
    existsHistDailyData = (dailyBars.Count <= 1) ? false : true;
    isInitializing = false;
    isDailyDataLoaded = true;
    }
    if (existsHistDailyData)
    {
    if ( ( Count -1 - CurrentBar ) == 0 ) {
    yesterdayDailyBar = dailyBars.Get(dailyBars.Count-1);
    if ( yesterdayDailyBar.Time != D1 || FirstTickOfBar ) {
    D1 = yesterdayDailyBar.Time;
    double YC = yesterdayDailyBar.Close;
    ......
    }
    }
    }
    }



    - Clearpicks

    #2
    >> Could you help me on how to access daily data series from an indicator running on intraday charts?
    Unfortunately this is not supported.

    Comment


      #3
      I heard that NinjaTrader is going to support multi-symbol data series in inidicators in NT 7.0. When is it going to be released? Will it support multi-timeframe also?

      - Clearpicks

      Comment


        #4
        We have multi-series support for indicators on our list for NT7. We expect to have beta available by end of this year.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X