TradingView
EsIstTurnt
1 déc. 2022 12:46

Dynamic Highest Lowest Moving Average 

GOLD (US$/OZ)TVC

Description

Similar to my last script, although this one uses the RSI value of
(highest high - price) / (price - lowest low)
to feed into the the logic creating the dynamic length. Choose how the length curve works by selecting either Incline, Decline, Peak or Trough.
Lastly select the moving average type to filter the result through to smoothen things out a bit
to find something that works for your strategy. This is useful as an entry/exit indicator along with other moving averages, or even just a standalone if you play with the settings enough.

Notes de version

Overlay = True

Notes de version

Cleaned up, fix chart image

Notes de version

Added more thorough explanation of how we arrive at the average.
Added ability to change the coeficcient, in how different each step up/down will be
Added option to include the current, or former price in the averaging of the highest/lowest values
Commentaires
Omni-Trading
I looks behind.. Shouldnt the curve be over the top bar? why is it lagged?
EsIstTurnt
@OmniTekTrading, Lag is most likely due to the inherent nature of moving averages, but could be mitigated by shortening the "smoothlen" and/or "maxHigh" and "maxLow" parameters.
Plus