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. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟