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.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?