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

Highest and Lowest values for a specific indicator over the previous XX Bars

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

    Highest and Lowest values for a specific indicator over the previous XX Bars

    I have a basic question about the highest and lowest values for a specific indicator in the previous XX bars. I see examples that refer to price, but I haven't come across one that uses an indicator with its appropriate settings.

    I would like to subtract the highest RSI value from the lowest RSI value from the preceding 1-7 bars. I do not want to use the current bar in this calculation.

    The indicator:

    RSI(BarsArray[1], 14, 1)


    I have seen MIN, MAX, HighestBar(), and LowestBar(). I am not sure which to use in this calculation. What is the correct way to achieve this result?

    Thanks in advance.
    Last edited by ArmKnuckle; 12-17-2019, 03:33 AM.

    #2
    Hello ArmKnuckle,

    Thanks for your post.

    With reference to the Syntax of the Min (and MAX) methods you will note it shows (ISeries<double> input, int period). this means you can basically use any input series. Typically this would be price such as Close(the default) High, low, etc.

    In the case of the RSI it appears you have an added data series, so to obtain the MIN of the RSI of the added data series: MIN(RSI(Closes[1], 14, 1).Default, 7)[1]. Likewise MAX((RSI(Closes[1], 14, 1).Default, 7)[1]. By using the barsAgo index of [1] this would not consider the current bar value of the RSI and would look at the previous 7 bars.

    References:


    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,605 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    13 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X