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).
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.