Optimal Moving Average (AI/ML) [wbburgin]

The fact of the matter is that no moving average will ever be a consistent indicator for a serious trader - a fixed-length moving average will always need confirmation indicators and tests. When your instrument is trending, you need a faster moving average to better fit the data; when your instrument is ranging, you need a slower moving average that cleans the data. This just is not possible given the way the moving average is traditionally coded, which makes it a lagging indicator.
Thus we need a moving average that:
- can project the next prices, and
- can change its length depending on what best fits these future prices.
The Optimal Moving Average selects the optimal moving average length for a projected future price. The algorithm classifies moving averages by their effectiveness in predicting future price movement. If a moving average of length n has historically been accurate in predicting the next bar, the moving average will be tested compared to its peers (n-1, n+5, n-100, etc.) and promoted or demoted depending on its effectiveness. This means that the indicator will not have a length input like other static moving averages or machine-learning moving averages on TradingView- it will select the ideal length for your chart from the average that has the least error and best prediction.
Advantages over other ML Moving Averages on TradingView
The vast majority of AI/ML moving average algorithms classify their moving averages only by if the average is above or below the current price.
This approach is inherently flawed because the model
- Is not predictive of future prices (the structural lagging problem still exists),
- Is not built on a variable-length MA (cannot select alternating lengths depending on the bar), and
- does not classify the scale of difference between the MA and the price.
This indicator solves all those problems. It classifies moving averages by the scale of which their rate predicts the next price. Thus it is quick to catch trend changes but also acts as support or resistance, and models the projected price more accurately than a traditional moving average.
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả cho phép mới có quyền truy cập vào tập lệnh này và thường phải trả phí. Bạn có thể thêm tập lệnh vào mục yêu thích, nhưng bạn sẽ chỉ có thể sử dụng sau khi yêu cầu cấp phép và được tác giả cấp quyền — hãy tìm hiểu thêm tại đây. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với wbburgin.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Cảnh báo: vui lòng đọc hướng dẫn của chúng tôi về các tập lệnh chỉ dành cho người được mời trước khi yêu cầu quyền truy cập.
BTC: 35PdMMMXFCvPjXKwn8wsRFNwMEPgStaKUJ
Test my strategies on CryptoRobotics: cryptorobotics.co/?trade=f23b09
Thông báo miễn trừ trách nhiệm
Tập lệnh chỉ hiển thị cho người được mời
Chỉ những người dùng được tác giả cho phép mới có quyền truy cập vào tập lệnh này và thường phải trả phí. Bạn có thể thêm tập lệnh vào mục yêu thích, nhưng bạn sẽ chỉ có thể sử dụng sau khi yêu cầu cấp phép và được tác giả cấp quyền — hãy tìm hiểu thêm tại đây. Để biết thêm chi tiết, hãy làm theo hướng dẫn của tác giả bên dưới hoặc liên hệ trực tiếp với wbburgin.
TradingView KHÔNG khuyến khích trả tiền hoặc sử dụng tập lệnh trừ khi bạn hoàn toàn tin tưởng tác giả và hiểu cách hoạt động của tập lệnh. Bạn cũng có thể tìm thấy các giải pháp thay thế miễn phí, mã nguồn mở trong mục tập lệnh cộng đồng của chúng tôi.
Hướng dẫn của tác giả
Cảnh báo: vui lòng đọc hướng dẫn của chúng tôi về các tập lệnh chỉ dành cho người được mời trước khi yêu cầu quyền truy cập.
BTC: 35PdMMMXFCvPjXKwn8wsRFNwMEPgStaKUJ
Test my strategies on CryptoRobotics: cryptorobotics.co/?trade=f23b09