kurtsmock

Dead Simple Heikin Ashi Candles (HA Candles)

kurtsmock 已更新   
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.
版本注释:
Added Color modification capability by request.
版本注释:
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

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?