OPEN-SOURCE SCRIPT
ATR and Stochastics by Xeodiac

This script combines two popular indicators, the Average True Range (ATR) and the Stochastic Oscillator, into a single chart for enhanced trading insights. Here’s a breakdown of how it works and what it does:
What It Does:
Average True Range (ATR):
Measures market volatility by calculating the average range of price movement over a specified period.
The ATR is plotted in blue on its natural scale, helping you assess how volatile the market is.
Stochastic Oscillator:
A momentum indicator that compares a security's closing price to its price range over a specific period.
It calculates two lines:
%K Line (Green): Tracks the raw Stochastic value.
%D Line (Red): A smoothed moving average of the %K line.
These values are plotted on a percentage scale (0-100) to indicate overbought or oversold conditions.
Inputs:
ATR Length: Specifies the number of periods used for ATR calculation (default is 14).
Stochastic %K Length: Determines the period for finding the highest high and lowest low for the %K calculation (default is 14).
Stochastic %D Smoothing: Sets the smoothing factor for the %D line (default is 3).
Visual Output:
Blue Line: Represents the ATR, showing how much price moves on average over the given period.
Green Line: The %K line of the Stochastic Oscillator, showing momentum shifts in the market.
Red Line: The %D line of the Stochastic Oscillator, providing a smoothed perspective on momentum.
Use Case:
This script is useful for:
Assessing Market Volatility: Use the ATR to understand how active the market is.
Identifying Overbought/Oversold Levels: Use the Stochastic Oscillator to identify potential reversal points.
Combining Signals: Analyze both indicators together to align volatility and momentum for better trading decisions.
What It Does:
Average True Range (ATR):
Measures market volatility by calculating the average range of price movement over a specified period.
The ATR is plotted in blue on its natural scale, helping you assess how volatile the market is.
Stochastic Oscillator:
A momentum indicator that compares a security's closing price to its price range over a specific period.
It calculates two lines:
%K Line (Green): Tracks the raw Stochastic value.
%D Line (Red): A smoothed moving average of the %K line.
These values are plotted on a percentage scale (0-100) to indicate overbought or oversold conditions.
Inputs:
ATR Length: Specifies the number of periods used for ATR calculation (default is 14).
Stochastic %K Length: Determines the period for finding the highest high and lowest low for the %K calculation (default is 14).
Stochastic %D Smoothing: Sets the smoothing factor for the %D line (default is 3).
Visual Output:
Blue Line: Represents the ATR, showing how much price moves on average over the given period.
Green Line: The %K line of the Stochastic Oscillator, showing momentum shifts in the market.
Red Line: The %D line of the Stochastic Oscillator, providing a smoothed perspective on momentum.
Use Case:
This script is useful for:
Assessing Market Volatility: Use the ATR to understand how active the market is.
Identifying Overbought/Oversold Levels: Use the Stochastic Oscillator to identify potential reversal points.
Combining Signals: Analyze both indicators together to align volatility and momentum for better trading decisions.
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.