peacefulLizard50262

Pivot Point Moving Average (PPMA)

The script is an implementation of an indicator called "PPMA", which stands for "Pivot Point Moving Average." This indicator is designed to be used as a overlay, meaning that it will be plotted on top of the underlying asset's price chart.

The main function of the PPMA indicator is to calculate a moving average based on pivot points of the underlying asset. Pivot points are commonly used in technical analysis to identify key levels of support and resistance, and this indicator uses the pivot points in a unique way to calculate the moving average.

The indicator's main function, "ppma()," is defined as taking two input parameters, "left" and "right." These parameters determine the number of bars to the left and right of a pivot point that will be used to calculate the moving average. The function uses the "ta.pivothigh()" and "ta.pivotlow()" functions to identify pivot points for the high and low prices, respectively. Then the function uses the "ta.change()" function to identify if there is a change in pivot point.

The function keeps track of the number of bars and their sum from the last pivot point until the next pivot point is reached. If there is a change in pivot point, it will reset the count and sum. It will return the sum divided by the count, which is the moving average of the prices between the two pivot points.

The script then uses the PPMA function to plot the moving average on the chart using the "plot()" function. The user is able to adjust the number of bars to the left and right of the pivot point using the "left" and "right" input parameters.

In summary, the PPMA indicator is a unique moving average that uses pivot points to calculate the average. It is designed to be used as an overlay on top of an underlying asset's price chart and can be adjusted by the user to suit their needs. It can help traders identify key levels of support and resistance in the underlying asset.

开源脚本

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

免责声明

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

想在图表上使用此脚本?