• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Data Series

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

  • kiss987
    started a topic Indicator Data Series

    Indicator Data Series

    I want to get the values of an indicator from a different data series which I run on.
    For example, my strategy is running on a 10 range chart but I want to get the RSI values from a 200 range.

    Thanks

  • NinjaTrader_AlanP
    replied
    Hello kiss987,

    To pass a series other than the primary series to an indicator you would use Highs[1] or Lows[0], for example SMA(Lows[1])[0], would be passing the low series of the secondary series added to a script
    .
    I have provided a sample script which will print the highs and lows of the 1st, 2nd, and third series added to the script.

    You could also see under Multi-Time Frame ISeries,
    https://ninjatrader.com/support/help...riceseries.htm

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • kiss987
    replied
    Hi,

    Simple example:

    if (State == State.DataLoaded)
    {
    avg = new Series<double>(this);
    }


    protected override void OnBarUpdate()
    {
    avg[0] = (High[0] + Low[0]) / 2;
    }

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello kiss987,

    So I may provide you the best answer, would you be able to provide a sample indicator which takes two inputs?

    I look forward to your reply.

    Leave a comment:


  • kiss987
    replied
    Thank you for your reply.

    The RSI indicator uses only one data series as an input (Closes[1] in the example), so there's no problem.
    However, what if my custom indicator needs more than 1 input. For example, both Highs and Lows values.
    When my indicator takes the data from the chart directly there's no problem because I can simply use the High[x] and Low[x[ values, however I don't know how to get those values when I don't use the chart as a data series.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello kiss987,

    Thank you for your note.

    I’ve attached a sample which will print to the output window the RSI of the secondary series added to the strategy which is a 1 range series.

    You would want to use the RSI Syntax which includes the ISeries, which is how you pass the indicator the secondary series.

    https://ninjatrader.com/support/help..._index_rsi.htm

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by ninjo, Today, 02:42 PM
1 response
3 views
0 likes
Last Post NinjaTrader_Jesse  
Started by Longhornmark, Today, 01:13 PM
5 responses
12 views
0 likes
Last Post Longhornmark  
Started by ntbone, Today, 12:34 PM
3 responses
17 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by deltaZ, Today, 12:41 PM
1 response
12 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by pjsmith, Today, 12:21 PM
1 response
4 views
0 likes
Last Post NinjaTrader_PatrickG  
Working...
X