Announcement

Collapse
No announcement yet.

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:


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    93 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    123 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    73 views
    0 likes
    Last Post PaulMohn  
    Working...
    X