zigzagMoves

6 EMA/SMA/RMA + Forecasting 10 candles

6EMA/SMA/RMA + Forecasting 10 candles
The script allows the user to choose between different types of moving averages (SMA, EMA, RMA) using the soft_func_choice input.
The user can also choose between two types of forecasting: "Repetition" or "Linear Regression" using the type_of_forecast input.
For the linear regression forecast, the user can specify the number of candles to use in the linear regression calculation using the Linreglen input.
First Moving Average (MA) Calculation:

The script calculates the first MA based on the selected type (SMA, EMA, RMA) and plots it on the chart.
The user can customize the length and source of data for this MA.
If the selected forecast type is "Repetition," the script also calculates additional offset values for different repetitions of the MA.
Forecasting and Offset Calculation:

Depending on the chosen forecast type, the script calculates additional offset values for the MA. These offsets are used to forecast the future values of the MA.
The script calculates offsets for up to five repetitions (offset1, offset2, ..., offset5) for each MA.
If the forecast type is "Linear Regression," the script combines the MA's historical values with linear regression predictions to generate the forecasted values.
Plotting Additional Moving Averages:

The script allows the user to plot up to four additional MAs (Second MA, Third MA, Fourth MA, Fifth MA) with similar customizable settings for length and source of data.
Forecast Repetition:

If the forecast type is "Repetition," the script iterates through historical data and accumulates offset values, effectively simulating a repeated forecasting approach.
This repetition is controlled by a loop that adjusts the offset values based on historical price data.
Overall, this script provides a versatile tool for analyzing and forecasting multiple moving averages using various methods, allowing traders and analysts to experiment with different MA types and forecast strategies on their chosen price series.
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

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

想在圖表上使用此腳本?