• 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

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:
    https://ninjatrader.com/support/help...inimum_min.htm
    https://ninjatrader.com/support/help...aximum_max.htm
    https://ninjatrader.com/support/help..._index_rsi.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rontronimous, Today, 06:12 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by Vinhasa, Today, 03:15 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by 1001111, Today, 03:03 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Tyler  
    Started by Seedbird, Today, 03:06 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_BrendanC  
    Started by mtamaku, Today, 02:46 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X