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

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?