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).
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.