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 open-source

In pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e verificarlo. Un saluto all'autore! È possibile utilizzarlo gratuitamente, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?


Anche su:

Declinazione di responsabilità