ka66

ka66: Auto-Guppy Multiple Moving Average (GMMA)

This implements a Guppy Multiple Moving Average (GMMA) with the following twists, which may be a feature or a bug, depending on your perspective:

  • For both fast and slow group of MAs, only a starting MA (the fastest in that group) is specified.
  • For either group, a configurable factor is set, which will be used to calculate subsequent MAs.
  • Automatically selects colours as gradients within a configurable colour range, clearly differentiating between the short-term and long-term groups of averages.
  • Use Weighted Moving Average (WMAs) as the averaging mechanism. More on this later.

For example, if in the fast group, we start with MA 3, and a factor of 2, then the 6 MAs in the group will be: 3, 6, 12, 24, 48, 96.

The calculated lookbacks are displayed on a table on the top-right, in case further indicators need to be calculated based on these values.

Use of WMAs: This is an annoyance of the implementation: As I use arrays to store lookback calculations (12 of them, individual variables would be a pani to work with!), getting these back out of the array returns a series rather than a simple value. For some unfathomable reason, PineScript doesn't allow copying/conversion of these into a simple value. To add insult to the injury, a bunch of moving averaging functions (e.g.: ta.ema, ta.hma) only work with simple int lookback values. Go figure. SMAs and WMAs are the two that allow series lookback values, and WMAs are less laggy than SMAs but remain smooth, so WMAs it is!
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 đồ?