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.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?