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.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?