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 NullPointStrategies, Today, 05:17 AM
    0 responses
    20 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    119 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X