OPEN-SOURCE SCRIPT
已更新

Regression Indicator [BigBeluga]

25 829
Regression Indicator

Indicator Overview:
The Regression Indicator is designed to help traders identify trends and potential reversals in price movements. By calculating a regression line and a normalized regression indicator, it provides clear visual signals for market direction, aiding in making informed trading decisions. The indicator dynamically updates with the latest market data, ensuring timely and relevant signals.

Key Features:

Calculations
Regression Indicator: Calculates the linear regression coefficients (slope and intercept) and derives the normalized distance close from the regression line.
Pine Script®
// @function regression_indicator is a Normalized Ratio of Regression Lines with close regression_indicator(src, length) => sum_x = 0.0 sum_y = 0.0 sum_xy = 0.0 sum_x_sq = 0.0 distance = 0.0 // Calculate Sum for i = 0 to length - 1 by 1 sum_x += i + 1 sum_y += src sum_xy += (i + 1) * src sum_x_sq += math.pow(i + 1, 2) // Calculate linear regression coefficients slope = (length * sum_xy - sum_x * sum_y) / (length * sum_x_sq - math.pow(sum_x, 2)) intercept = (sum_y - slope * sum_x) / length // Calculate Regression Indicator y1 = intercept + slope distance := (close - y1) distance_n = ta.sma((distance - ta.sma(distance, length1)) / ta.stdev(distance, length1), 10) [distance_n, y1]


⦿ Reversion Signals:
Marks potential trend reversal points.
快照

⦿ Trend Identification:
Highlights when the regression indicator crosses above or below the zero line, signaling potential trend changes.
快照

⦿ Color-Coded Candles:
Changes candle colors based on the regression indicator's value.
快照

⦿ Arrow Markers:
Indicate trend directions on the chart.
快照


⦿ User Inputs
  • Regression Length: Defines the period for calculating the regression line.
  • Normalization Length: Period used to normalize the regression indicator.
  • Signal Line: Length for averaging the regression indicator to generate signals.
  • Main Color: Color used for plotting the regression line and signals.



The Regression Indicator is a powerful tool for analyzing market trends and identifying potential reversal points. With customizable inputs and clear visual aids, it enhances the trader's ability to make data-driven decisions. The dynamic nature of the indicator ensures it remains relevant with up-to-date market information, making it a valuable addition to any trading strategy."
發行說明
- Regression calculation fix
(y1 = intercept + slope * length)
發行說明
-Update to pine script V6

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。