Following some recommendations and ideas I share this moving average, put all of them together
- The length calculation is automatic there is only one input.
- The length is inverse so it will wrap from the longest reference point, hence using phi
- Moving averages will wrap around the price.
- I've also added gradient color to plots and fill plots
- There is an alert selector in case you are interested in a particular crossing, "remember that the order is reversed".
- There is an alert visual plotshapes with offset signal.
Some references about by "tradingview pinecoders"
What to look for
The Moving Average has three elements to it:
Window: This element is the period. By default, the window is set to 9 periods, but it can be customized to fit any trading style.
Offset: This element is the Gaussian that is applied to the combo line and can be aligned to the current price. It’s default is set to 0.85, but by setting it to 1, you can make it align fully to the current price (similar to how an ( ) with a setting of 0 is like a ( )). 0.85 is what is recommended, however, you can customize it like with the window element.
Sigma: This element is a standard deviation that is applied to the combo line in order for it to appear more sharp . The default is set to 6 and it is not recommended to change the setting. The value of 6 is inspired by the Six Sigma process.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.