Store DEMA Indicator High/Low
Forums › ProRealTime English forum › ProBuilder support › Store DEMA Indicator High/Low
- This topic has 6 replies, 3 voices, and was last updated 5 years ago by Vonasi.
-
-
11/19/2019 at 8:39 AM #113086
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.
11/19/2019 at 9:27 AM #113094There yo go:
123MyIndicator = DEMA[Variable](Close)MyIndicatorHi = Highest[variable](MyIndicator)MyIndicatorLo = Lowest[variable](MyIndicator)11/19/2019 at 9:51 AM #113099Hi 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.
11/19/2019 at 9:54 AM #11310011/19/2019 at 10:08 AM #113102It’s not possible, when you calculate an average, whatever it is, such as:
1Average[10](close)you cannot ask it to use HIGH for just the most recent period.
You could use
1(Average[10](close) + high) / 2but it’s not the same.
1 user thanked author for this post.
11/19/2019 at 10:19 AM #11310411/19/2019 at 10:29 AM #113106 -
AuthorPosts
Find exclusive trading pro-tools on