OPEN-SOURCE SCRIPT

Linear Regression Trend Channel

已更新
The "Linear Regression Trend Channel" is a technical indicator designed to illustrate price trends and their volatility using linear regression. This indicator calculates the main linear regression line based on the user-defined period length and computes the standard deviation to form a trend channel.

Key Features:

- Linear Regression Calculation: Computes the linear regression line based on the selected price data source and the defined period length.
- Slope and Intercept Calculation: Calculates the slope and intercept of the linear regression line using the calcSlopeIntercept function.
- Deviation Channels: Adds standard deviation channels to the linear regression line to highlight potential support and resistance areas.

Settings

- Linear Regression Length: Specifies the length of the period for the linear regression calculation (default: 100).
- Linear Regression Source: Defines the data source for the linear regression calculation, such as close price, open price, etc. (default: close).
- Linear Regression Color: Sets the color of the linear regression line (default: gray).
- Show Price Labels: Option to display price labels on the horizontal lines (default: true).

How to Use

- Set the Linear Regression Length to define the period for regression calculation.
- Choose the Linear Regression Source to specify the price data (e.g., close, open).
- Enable or disable Show Price Labels based on whether you want to see price labels on the horizontal lines.

This Indicator helps identify dynamic support and resistance levels and potential market turning points.
版本注释
The "Linear Regression Trend Channel" is a technical indicator designed to illustrate price trends and their volatility using linear regression. This indicator calculates the main linear regression line based on the user-defined period length and computes the standard deviation to form a trend channel.

Key Features:

- Linear Regression Calculation: Computes the linear regression line based on the selected price data source and the defined period length.
- Slope and Intercept Calculation: Calculates the slope and intercept of the linear regression line using the calcSlopeIntercept function.
- Deviation Channels: Adds standard deviation channels to the linear regression line to highlight potential support and resistance areas.

Settings

- Linear Regression Length: Specifies the length of the period for the linear regression calculation (default: 100).
- Linear Regression Source: Defines the data source for the linear regression calculation, such as close price, open price, etc. (default: close).
- Linear Regression Color: Sets the color of the linear regression line (default: gray).
- Show Price Labels: Option to display price labels on the horizontal lines (default: true).

How to Use

- Set the Linear Regression Length to define the period for regression calculation.
- Choose the Linear Regression Source to specify the price data (e.g., close, open).
- Enable or disable Show Price Labels based on whether you want to see price labels on the horizontal lines.

Add Customization:

- Linear Regression Color: Sets the color of the linear regression line.
- Label Price Color: Sets the color of the displayed price labels.
- Show Price: Option to display or hide the price labels.
- Show Horizontal Line: Option to display or hide horizontal lines.

This Indicator helps identify dynamic support and resistance levels and potential market turning points.
版本注释
Add Customization:

- Linear Regression Color: Sets the color of the linear regression line.
- Label Price Color: Sets the color of the displayed price labels.
- Show Horizontal Line: Option to display or hide horizontal lines.
- Show Price: Option to display or hide the price labels.
版本注释
Updates:
High/Low Timeframe Addition:

The High/Low lines mark the highest and lowest prices over a chosen timeframe (e.g., daily, weekly). These levels often act as support and resistance.

- Added an input parameter to select the timeframe (e.g., daily, weekly) for displaying High and Low levels.
- Added an input to choose the color of the High/Low lines.
- Added an option to show or hide the High/Low lines on the chart.

The High/Low lines make it easier to see key price points on the chart, set price targets, and identify trends, improving readability.
版本注释
- Added Timeframe Options: Expanded the available timeframes for high/low calculations to include daily, weekly, monthly, 3-month, 6-month, and yearly intervals.
- Extended High/Low Lines: Enhanced the high/low lines to extend both forward and backward, providing a clearer historical and future reference.
- General Improvements: Minor code optimizations for better performance and accuracy.
jeetbeezLinear RegressionTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明