OPEN-SOURCE SCRIPT

Monthly EMA Touches Counter

Key Features of This Script:
Touch Threshold: The script checks if the price is within a specified percentage of each EMA.
Monthly Touch Counters: Separate counters (touchCountEMA12, touchCountEMA26, touchCountEMA50) are used to count touches for each EMA.
Reset Logic: All counters reset at the start of a new month using if ta.change(time("M")).
Increment Logic: Each counter increments whenever the corresponding EMA is touched during a bar.
Label Management: Labels are created to display each count above the bars at the end of each month.
Alert Conditions: Alerts are set up for when the price touches any of the EMAs.
Usage:
Copy and paste this script into TradingView's Pine Script editor.
Add it to your chart to see how many times the price has touched each of the EMAs (12, 26, and 50) on a monthly basis.
Adjust the Touch Threshold (%) input as needed for sensitivity.
This implementation will allow you to effectively track and visualize how often price touches each of these EMAs on a monthly basis. If you have further modifications or additional features you'd like to explore, feel free to ask
Moving Averages

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


También en:

Exención de responsabilidad