kurtsmock

Dead Simple Heikin Ashi Candles (HA Candles)

kurtsmock Uppdaterad   
Are you looking for a dead simple calculation of the Heikin Ashi candles as they are calculated in tradingview? Here it is!

I was looking through the library and I saw that many have come up with a lot of awesome scripts using heikin ashi candles. But, I can't find anywhere that had the straightforward simple version of how Tradingview calculates them. This was a problem for me because I realized after punching the formula in that TradingView doesn't calculate HA candles in the original way.

You might say they don't calculate them the "right" but, spoiler alert, there is no right in trading. You can only be rational or irrational as you make money or lose money.

This is useful to me for building out some portions of an algo that are not going to be compatible with the built-in function. It happens. So, if you were looking for it too, hopefully it saves you some time.

For reference the original calc of HA candles is:
o = (prev_HA_open + prev_HA_close) / 2
h = math.max(high, ha_open, ha_close)
l = math.min(low, ha_open, ha_close)
c = ohlc4 

Trade Well.
Versionsinformation:
Added Color modification capability by request.
Versionsinformation:
AAAAAnnnddd there was a typo in the code. 🤦

Before I die I hope that just once I can publish something that doesn't immediately require an update. lol

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?