OPEN-SOURCE SCRIPT
Regression Slope Oscillator

Description:
The Regression Slope Oscillator is a momentum indicator that measures the slope of a linear regression curve. It can help traders identify the current trend direction as well as the acceleration or deceleration of a trend early on.
How Does the Indicator Work?
The core of the indicator calculates the difference between the current and the previous value of a linear regression. This value reflects the slope:
Values above the zero line: Indicate an uptrend.
Values below the zero line: Indicate a downtrend.
Additionally, a signal line is calculated. Crossovers between the oscillator and the signal line provide indications of potential trend changes.
The Color Logic (Momentum Strength)
The oscillator line and its fill use a dynamic 4-color system to display the strength of the market momentum at a glance:
Dark Turquoise (Bull Strong): The oscillator is above zero and rising. The uptrend is gaining momentum.
Light Turquoise (Bull Weak): The oscillator is above zero but falling. The uptrend is flattening out.
Dark Pink (Bear Strong): The oscillator is below zero and falling further. The downtrend is accelerating.
Light Pink (Bear Weak): The oscillator is below zero but rising. The downtrend is losing strength (recovery).
Main Features & Settings
Customizable Signal Line: Flexibly choose between various moving averages for the signal line (SMA, EMA, HMA, or VWMA).
Customizable Lengths: The lengths for both the linear regression and the signal line can be freely adjusted in the settings.
Built-in Signals: White dots mark the exact moment the regression oscillator crosses the signal line (crossovers/crossunders).
The Regression Slope Oscillator is a momentum indicator that measures the slope of a linear regression curve. It can help traders identify the current trend direction as well as the acceleration or deceleration of a trend early on.
How Does the Indicator Work?
The core of the indicator calculates the difference between the current and the previous value of a linear regression. This value reflects the slope:
Values above the zero line: Indicate an uptrend.
Values below the zero line: Indicate a downtrend.
Additionally, a signal line is calculated. Crossovers between the oscillator and the signal line provide indications of potential trend changes.
The Color Logic (Momentum Strength)
The oscillator line and its fill use a dynamic 4-color system to display the strength of the market momentum at a glance:
Dark Turquoise (Bull Strong): The oscillator is above zero and rising. The uptrend is gaining momentum.
Light Turquoise (Bull Weak): The oscillator is above zero but falling. The uptrend is flattening out.
Dark Pink (Bear Strong): The oscillator is below zero and falling further. The downtrend is accelerating.
Light Pink (Bear Weak): The oscillator is below zero but rising. The downtrend is losing strength (recovery).
Main Features & Settings
Customizable Signal Line: Flexibly choose between various moving averages for the signal line (SMA, EMA, HMA, or VWMA).
Customizable Lengths: The lengths for both the linear regression and the signal line can be freely adjusted in the settings.
Built-in Signals: White dots mark the exact moment the regression oscillator crosses the signal line (crossovers/crossunders).
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.