OPEN-SOURCE SCRIPT

Moving Average Cross; Linear Regression

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.
Moving Averagesmultitimeframeregressions

开源脚本

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

想在图表上使用此脚本?

免责声明