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

Indicator Data Series

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

  • 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,


    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.



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

    Leave a comment:


  • 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

Latest Posts

Collapse

Topics Statistics Last Post
Started by RookieTrader, Today, 09:37 AM
3 responses
15 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by kulwinder73, Today, 10:31 AM
0 responses
5 views
0 likes
Last Post kulwinder73  
Started by terofs, Yesterday, 04:18 PM
1 response
23 views
0 likes
Last Post terofs
by terofs
 
Started by CommonWhale, Today, 09:55 AM
1 response
4 views
0 likes
Last Post NinjaTrader_Erick  
Started by Gerik, Today, 09:40 AM
2 responses
7 views
0 likes
Last Post Gerik
by Gerik
 
Working...
X