LuxAlgo

Moving Averages Proximity Oscillator [LuxAlgo]

This indicator returns the percentage or count of prices greater than simple moving averages with periods in a user set range, as well as the moving average period that is the closest to price values.

Settings

  • Minimum Length: Minimum SMA period
  • Maximum Length: Maximum SMA period
  • Smooth: Control the degree of smoothness of the indicator outputs
  • Normalized: Normalize the indicator outputs in a range (0, 100)
  • Src: Input source of the indicator

Usage

The indicator returns two outputs.

 
The "Price Above MA's" output returns for a current price value the number of times this one is greater than simple moving averages with periods ranging from Minimum Length to Maximum Length. This oscillator can be expressed as a percentage if Normalized is selected.


This oscillator allows identifying the direction of an underlying trend in the price. Higher Minimum Length and Maximum Length settings will return indications regarding longer term price variations, while shorter ranges will return less detailed outputs. This can be seen in the chart above where Minimum Length = 80 to Maximum Length = 100.

The "Proximity Index" output on the other end does not return information regarding the direction of an underlying trend but the period of the simple moving average with periods ranging from Minimum Length to Maximum Length that is the closest to the current price value.


For various simple moving averages of differing periods, we can see that SMA's with shorter periods will tend to stay closer to the price, when price start reverting it will reach higher periods moving averages.


As such, this second indicator output can help identify the start of new trends, with higher values indicating price is reverting toward longer-term moving averages, suggesting a new trend forming.
版本注释:
Minor changes.

Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?