Store DEMA Indicator High/Low

Forums ProRealTime English forum ProBuilder support Store DEMA Indicator High/Low

Viewing 7 posts - 1 through 7 (of 7 total)
  • #113086
    Ξ3

    Hi,

    Is there a way to store or calculate the highest / lowest value that an indicator reached for each bar?

    MyIndicator = DEMA[Variable](Close)

    MyIndicatorHi = Highest value that MyIndicator reached during the formation of a particular bar

    MyIndicatorLo = Lowest value that MyIndicator reached during the formation of a particular bar

    Many Thanks.

    #113094

    There yo go:

     

    #113099
    Ξ3

    Hi Roberto,

    Many thanks for your response but I think my request was not clear enough.

    In your code the Highest function returns the highest CLOSE value in the past “variable” periods.
    What I would like to store/calculate is the highest HIGH/LOW value per bar (so only for 1 period)

    MyIndicatorHi = DEMA[Variable](High) won’t work either as it uses the High value for current and past “variable” periods.
    What I am looking for is some way to use the High (or Low) value for the current bar but the Close value for past “variable” periods.

    A simple 3 period MA would be:
    MyMA = Close + Close[1] + Close[2]
    MyMAHi = High + Close[1] + Close[2]
    MyMALo = Low + Close[1] + Close[2]

    But how to calculate this for an Infinite Impulse Response (IIR) filter with a variable lookback period such as a DEMA is what I am trying to do.

    #113100
    Ξ3

    CORRECTION:

    A simple 3 period MA would be:
    MyMA = (Close + Close[1] + Close[2]) / 3
    MyMAHi = (High + Close[1] + Close[2]) / 3
    MyMALo = (Low + Close[1] + Close[2]) / 3

    #113102

    It’s not possible, when you calculate an average, whatever it is, such as:

    you cannot ask it to use HIGH for just the most recent period.

    You could use

    but it’s not the same.

     

    1 user thanked author for this post.
    avatar Ξ3
    #113104
    Ξ3

    Thanks for that Roberto. It gave me a new idea…
    Do you perhaps have the ProRealTime code to calculate the DEMA?

    #113106

    DEMA is quite simple to calculate:

     

    1 user thanked author for this post.
    avatar Ξ3
Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login