OPEN-SOURCE SCRIPT
업데이트됨 LinReg SlopeChange

This indicator is a precise trend-following tool that tracks the acceleration (rate of change) in the price's linear regression curve. While a standard Linear Regression (LR) indicator simply shows the direction of the price, this tool focuses on detecting whether a trend is gaining momentum or exhausting by measuring the Slope Delta.
Here is a detailed guide explaining the technical structure, parameters, and usage of the indicator:
1. Core Calculation Logic
-The indicator processes market movements through a three-stage mathematical filter:
-Linear Regression (LR): It calculates the "best-fit" line for prices over a specified period (len).
-Slope Percentage (Slope %): It calculates the difference between the current LR value and the previous bar's LR value, expressed as a percentage of the current value.
-Slope Change (Slope Delta): This is the heart of the indicator. It calculates the difference between the current slope percentage and the previous bar's slope percentage. Mathematically, this acts as the "acceleration" (second derivative) of the price action.
2. Input Parameters
-LR Length : The number of lookback bars used for the regression calculation. Higher values lag more but provide more reliable signals.
-Slope Change Threshold (%) : The minimum slope change required to trigger a signal. This can be increased to avoid false signals in noisy (sideways) markets.
-Source : The price data used for calculations (Usually set to close).
3. Signals and Visualization
The indicator operates on a sequential signal logic, meaning it does not produce consecutive "BUY" or "SELL" signals; it waits for a trend reversal.
BUY Signal: Occurs when the momentum of the slope (Slope Delta) breaks above your defined threshold_chg. It is marked by a green triangle on the chart.
SELL Signal: Occurs when the slope momentum breaks below the negative threshold. It is marked by a red inverted triangle.
Background Color: Highlights the active trend by shading the "BUY" zone green and the "SELL" zone red.
4. Usage Strategies
A. Catching Trend Reversals
Because this indicator notices weakening in the slope before the price fully turns, it can respond faster than classic Moving Averages (MA). If the slope begins to decrease (negative delta) during an uptrend, it may serve as a leading signal of a potential peak.
B. Consolidations and Breakouts
When the price is moving sideways, the slope is near zero. Thanks to the Slope Change Threshold parameter, the indicator captures the surge in momentum when price breaks out of stagnation, confirming the start of a new trend.
C. Filtering
Using this indicator in conjunction with a volume indicator (e.g., RV) or an oscillator (like RSI) will increase the success rate. It is particularly powerful for determining trend direction on higher timeframes (4H, Daily).
Note: The threshold_chg (Threshold) parameter should be adjusted according to the volatility of the pair you are trading. For volatile assets like cryptocurrencies, keeping this value slightly higher will reduce "whipsaw" or false signals.
Here is a detailed guide explaining the technical structure, parameters, and usage of the indicator:
1. Core Calculation Logic
-The indicator processes market movements through a three-stage mathematical filter:
-Linear Regression (LR): It calculates the "best-fit" line for prices over a specified period (len).
-Slope Percentage (Slope %): It calculates the difference between the current LR value and the previous bar's LR value, expressed as a percentage of the current value.
-Slope Change (Slope Delta): This is the heart of the indicator. It calculates the difference between the current slope percentage and the previous bar's slope percentage. Mathematically, this acts as the "acceleration" (second derivative) of the price action.
2. Input Parameters
-LR Length : The number of lookback bars used for the regression calculation. Higher values lag more but provide more reliable signals.
-Slope Change Threshold (%) : The minimum slope change required to trigger a signal. This can be increased to avoid false signals in noisy (sideways) markets.
-Source : The price data used for calculations (Usually set to close).
3. Signals and Visualization
The indicator operates on a sequential signal logic, meaning it does not produce consecutive "BUY" or "SELL" signals; it waits for a trend reversal.
BUY Signal: Occurs when the momentum of the slope (Slope Delta) breaks above your defined threshold_chg. It is marked by a green triangle on the chart.
SELL Signal: Occurs when the slope momentum breaks below the negative threshold. It is marked by a red inverted triangle.
Background Color: Highlights the active trend by shading the "BUY" zone green and the "SELL" zone red.
4. Usage Strategies
A. Catching Trend Reversals
Because this indicator notices weakening in the slope before the price fully turns, it can respond faster than classic Moving Averages (MA). If the slope begins to decrease (negative delta) during an uptrend, it may serve as a leading signal of a potential peak.
B. Consolidations and Breakouts
When the price is moving sideways, the slope is near zero. Thanks to the Slope Change Threshold parameter, the indicator captures the surge in momentum when price breaks out of stagnation, confirming the start of a new trend.
C. Filtering
Using this indicator in conjunction with a volume indicator (e.g., RV) or an oscillator (like RSI) will increase the success rate. It is particularly powerful for determining trend direction on higher timeframes (4H, Daily).
Note: The threshold_chg (Threshold) parameter should be adjusted according to the volatility of the pair you are trading. For volatile assets like cryptocurrencies, keeping this value slightly higher will reduce "whipsaw" or false signals.
릴리즈 노트
timeframe릴리즈 노트
sign릴리즈 노트
I changed the calculation method. Now, instead of using average value of slope delta, indicator uses average of previous slope values.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.