OPEN-SOURCE SCRIPT
[teachershim] draw sma 9/25/50/100/200/400

📌 Description — [teachershim] draw sma 9/25/50/100/200/400
This indicator displays Simple Moving Averages (SMA) for periods 9, 25, 50, 100, 200, and 400 on the chart.
It also marks the last confirmed bar’s SMA values with circular dots positioned to the right by a user-defined offset,
and labels each dot with the SMA period number for quick visual reference.
🔹 Features
SMA Lines
Plots SMA lines for periods 9 / 25 / 50 / 100 / 200 / 400 in distinct colors and thickness.
Last Value Markers
Adds circular markers (dots) at the SMA value of the last confirmed bar, shifted right by the specified offset.
SMA Period Labels
Displays the SMA period number (e.g., "9", "25", "50") just above each dot.
Customizable Parameters
Right offset for marker placement.
Vertical gap between marker and label (in percentage of chart range).
🔹 Parameters
Right Offset: Number of bars to place the marker/label to the right of the last bar.
Text Vertical Gap (%): Percentage offset to position the label above the dot.
🔹 Colors & Line Thickness
SMA 9 → Teal, thickness 1
SMA 25 → Orange, thickness 2
SMA 50 → Blue, thickness 2
SMA 100 → Purple, thickness 1
SMA 200 → Red, thickness 2
SMA 400 → Gray, thickness 1
🔹 Use Cases
Quickly identify key support/resistance levels across multiple SMA periods.
Instantly see the current SMA values without hovering over the chart.
Monitor SMA alignment and spacing for trend analysis or trading setups.
💡 Notes
If the right offset is too large, ensure your chart’s right margin is wide enough to display the markers.
max_labels_count in Pine Script limits how many labels can be displayed at once.
If you want, I can also make you a shorter, more concise “marketplace style” version for TradingView’s public library so it’s punchier and attracts more clicks.
Do you want me to prepare that?
This indicator displays Simple Moving Averages (SMA) for periods 9, 25, 50, 100, 200, and 400 on the chart.
It also marks the last confirmed bar’s SMA values with circular dots positioned to the right by a user-defined offset,
and labels each dot with the SMA period number for quick visual reference.
🔹 Features
SMA Lines
Plots SMA lines for periods 9 / 25 / 50 / 100 / 200 / 400 in distinct colors and thickness.
Last Value Markers
Adds circular markers (dots) at the SMA value of the last confirmed bar, shifted right by the specified offset.
SMA Period Labels
Displays the SMA period number (e.g., "9", "25", "50") just above each dot.
Customizable Parameters
Right offset for marker placement.
Vertical gap between marker and label (in percentage of chart range).
🔹 Parameters
Right Offset: Number of bars to place the marker/label to the right of the last bar.
Text Vertical Gap (%): Percentage offset to position the label above the dot.
🔹 Colors & Line Thickness
SMA 9 → Teal, thickness 1
SMA 25 → Orange, thickness 2
SMA 50 → Blue, thickness 2
SMA 100 → Purple, thickness 1
SMA 200 → Red, thickness 2
SMA 400 → Gray, thickness 1
🔹 Use Cases
Quickly identify key support/resistance levels across multiple SMA periods.
Instantly see the current SMA values without hovering over the chart.
Monitor SMA alignment and spacing for trend analysis or trading setups.
💡 Notes
If the right offset is too large, ensure your chart’s right margin is wide enough to display the markers.
max_labels_count in Pine Script limits how many labels can be displayed at once.
If you want, I can also make you a shorter, more concise “marketplace style” version for TradingView’s public library so it’s punchier and attracts more clicks.
Do you want me to prepare that?
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.