Better Heiken-Ashi Candles w/ Expanded Source Types [Loxx]

loxx Premium Aggiornato   
Better Heiken-Ashi Candles w/ Expanded Source Types is an indicator to compare regular candles to traditional Heiken-Ashi candles to "better" Heiken Ashi candles. This indicator and comparison study appears an oscillator. The purpose of this indicator is to demonstrate a better way to calculate HA candles and also to demonstrate expanded source types. This indicator is meant to be used by advanced Pine Coders who wish to add fine-tuning to their indicators and strategies.

What are Heiken Ashi "better" candles?
The "better formula" was proposed in an article/memo by BNP-Paribas (In Warrants & Zertifikate, No. 8, August 2004 (a monthly German magazine published by BNP Paribas, Frankfurt), there is an article by Sebastian Schmidt about further development (smoothing) of Heikin-Ashi chart.)

They proposed to use the following :
(Open+Close)/2+(((Close-Open)/( High-Low ))*ABS((Close-Open)/2))
instead of using :
haClose = (O+H+L+C)/4

According to that document the HA representation using their proposed formula is better than the traditional formula.

What are traditional Heiken-Ashi candles?
The Heikin-Ashi technique averages price data to create a Japanese candlestick chart that filters out market noise.

Heikin-Ashi charts, developed by Munehisa Homma in the 1700s, share some characteristics with standard candlestick charts but differ based on the values used to create each candle. Instead of using the open, high, low, and close like standard candlestick charts, the Heikin-Ashi technique uses a modified formula based on two-period averages. This gives the chart a smoother appearance, making it easier to spots trends and reversals, but also obscures gaps and some price data.

What's going on with this indicator?
- First, we have the options to select the candlestick type: Regular, HA, HA Better
- Next, and to demonstrate the expanded source types, I've added a simple moving average . In the drop down for the SMA source you'll notice something very different from the typical TradingView source selector. Here's how to decode the new names for the sources:

  • Close = close
  • Open = open
  • High = high
  • Low = low
  • Median = hl2
  • Typical = hlc3
  • Weighted = hlcc4
  • Average = ohlc4
  • Average Median Body = (open+close)/2
  • Trend Biased = (see code, too complex to explain here)
  • Trend Biased (extreme) = (see code, too complex to explain here)

... for HA and HA better, see the same set up as above but with different open and close values to calcualate the other source types

- For the HA better calculations, we run the close value through either an Adaptive, Kaufman, or T3 smoothing filter. The length for these smoothing filters, either 2 or 3, can be found in the code and is a constant value that shouldn't be changed. This smoothing is in inline with what is described in the article mentioned above
- Lastly, I've placed an SMA over the oscillator so that the user can test out the various sources explained above

- Toggle on/off bar coloring
Note di rilascio: Small display error. Please remove from your chart, reload TV and re-add.

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?