OPEN-SOURCE SCRIPT

Moving Average Cross; Linear Regression

1 254
This Pine Script is designed to display smoothed linear regression lines on a chart, with an option to adjust the regression period lengths and smoothing factor. The script calculates short-term and long-term linear regression lines based on the selected timeframe. These regression lines act as a regressed moving average cross, visually representing the interaction between the two smoothed linear regressions.

Short Regression Line: A linear regression line based on a short lookback period, colored blue for an uptrend and orange for a downtrend.

Long Regression Line: A linear regression line based on a longer lookback period, similarly colored blue for an uptrend and orange for a downtrend.

The script provides input options to adjust:

The length of short and long regression periods.
The smoothing length for the regression lines.
The timeframe for the linear regression calculations.

This tool can help traders observe the crossovers between the two smoothed linear regression lines, which are similar to moving average crossovers, but with the added benefit of regression-based smoothing to reduce noise. The color-coding allows for easy trend identification, with blue indicating an uptrend and orange indicating a downtrend.

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。