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.
版本注释
⋅
Overlay = True
版本注释
⋅
Cleaned up, fix chart image
版本注释
⋅
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
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.