OPEN-SOURCE SCRIPT
%MA

This indicator is designed to plot a Simple Moving Average (SMA) along with customizable upper and lower bands (% up/down) on a TradingView chart. Here's a brief but thorough explanation of its functionality:
TL;DR: This script shows percentages above and below customizable moving average timeframes & legnths. It's unique in the sense that it isn't on a separate pane & gives visual clarity against the price in real time HLOC.
1. Main SMA Plot
The script calculates a Simple Moving Average (SMA) based on user-defined inputs:
Timeframe: E.g., daily ("Daily") by default.
Length: E.g., 50 periods by default.
Color: Customizable by the user.
This SMA acts as the central reference line and can be toggled on or off using a "Show" option.
2. Upper and Lower Bands
The script generates two upper bands and two lower bands around the main SMA.
Each band is derived from an SMA (calculated similarly to the main SMA) and offset by a percentage:
Upper Bands: SMA × (1 + distance percentage / 100), e.g., SMA × 1.05 for a 5% offset.
Lower Bands: SMA × (1 - distance percentage / 100), e.g., SMA × 0.95 for a 5% offset.
These bands can indicate potential support, resistance, or volatility ranges.
3. Customization
Users can independently configure:
Visibility: Toggle each band and the main SMA on or off.
Timeframe: Set the timeframe for each SMA calculation.
Length: Define the SMA period.
Distance Percentage: Adjust the offset for each band.
Color: Choose colors for all plotted lines.
This flexibility allows tailored analysis for different trading strategies or timeframes.
4. Plotting
The main SMA and each band are plotted using TradingView’s plot function, but only if their respective "Show" options are enabled.
Lines are displayed with user-specified colors and styles (e.g., the main SMA has a linewidth of 2).
Purpose
This script provides a versatile tool for technical analysis, enabling traders to visualize an SMA with percentage-based bands to identify key price levels or ranges, such as support/resistance, volatility zones, and trends, with extensive customization options.
TL;DR: This script shows percentages above and below customizable moving average timeframes & legnths. It's unique in the sense that it isn't on a separate pane & gives visual clarity against the price in real time HLOC.
1. Main SMA Plot
The script calculates a Simple Moving Average (SMA) based on user-defined inputs:
Timeframe: E.g., daily ("Daily") by default.
Length: E.g., 50 periods by default.
Color: Customizable by the user.
This SMA acts as the central reference line and can be toggled on or off using a "Show" option.
2. Upper and Lower Bands
The script generates two upper bands and two lower bands around the main SMA.
Each band is derived from an SMA (calculated similarly to the main SMA) and offset by a percentage:
Upper Bands: SMA × (1 + distance percentage / 100), e.g., SMA × 1.05 for a 5% offset.
Lower Bands: SMA × (1 - distance percentage / 100), e.g., SMA × 0.95 for a 5% offset.
These bands can indicate potential support, resistance, or volatility ranges.
3. Customization
Users can independently configure:
Visibility: Toggle each band and the main SMA on or off.
Timeframe: Set the timeframe for each SMA calculation.
Length: Define the SMA period.
Distance Percentage: Adjust the offset for each band.
Color: Choose colors for all plotted lines.
This flexibility allows tailored analysis for different trading strategies or timeframes.
4. Plotting
The main SMA and each band are plotted using TradingView’s plot function, but only if their respective "Show" options are enabled.
Lines are displayed with user-specified colors and styles (e.g., the main SMA has a linewidth of 2).
Purpose
This script provides a versatile tool for technical analysis, enabling traders to visualize an SMA with percentage-based bands to identify key price levels or ranges, such as support/resistance, volatility zones, and trends, with extensive customization options.
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.