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.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?