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

    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 rtwave, Today, 01:49 PM
            0 responses
            8 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by papaoutai, Today, 08:56 AM
            0 responses
            22 views
            0 likes
            Last Post papaoutai  
            Started by jdspwe, Today, 05:22 AM
            0 responses
            13 views
            0 likes
            Last Post jdspwe
            by jdspwe
             
            Started by JeremuFemstu, Today, 04:49 AM
            0 responses
            16 views
            0 likes
            Last Post JeremuFemstu  
            Started by pjsmith, Today, 04:11 AM
            1 response
            22 views
            0 likes
            Last Post Green Lobster CBD  
            Working...
            X