• 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

    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

    #2
    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
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      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.

      Comment


        #4
        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.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          Simple example:

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


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

          Comment


            #6
            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
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by supermht, Today, 07:59 PM
            0 responses
            2 views
            0 likes
            Last Post supermht  
            Started by mohdhm, Today, 05:13 PM
            1 response
            12 views
            0 likes
            Last Post nkhoi
            by nkhoi
             
            Started by 3lliot, Today, 05:55 PM
            0 responses
            2 views
            0 likes
            Last Post 3lliot
            by 3lliot
             
            Started by Fargo, Today, 04:57 PM
            0 responses
            11 views
            0 likes
            Last Post Fargo
            by Fargo
             
            Started by Johnny Santiago, Today, 03:57 PM
            0 responses
            10 views
            0 likes
            Last Post Johnny Santiago  
            Working...
            X