Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Heikin Ashi calculation correct? #48

Open
iuliancioarca opened this issue Jan 7, 2023 · 0 comments
Open

Is Heikin Ashi calculation correct? #48

iuliancioarca opened this issue Jan 7, 2023 · 0 comments

Comments

@iuliancioarca
Copy link

iuliancioarca commented Jan 7, 2023

Please refer to: https://www.mssqltips.com/sqlservertip/7230/build-heikin-ashi-charts-in-excel-based-on-financial-time-series-data/

HA_close = (open_current + high_current + low_current + close_current)/4
HA_open = (HA_open_prior + HA_close_prior)/2
HA_high = maximum of (high_current, HA_open_current, or HA_close_current)
HA_low = minimum of (low_current, HA_open_current, or HA_close_current)

The hao is calculated as average of previous Heikin Ashi Open and Close, not the original OHLC data.

hac = mean(matr; dims=2)
hao = Vector{Float64}(undef, length(hac))
hao[1] = open[1]
for i=2:length(hac)
hao[i] = (hao[i-1]+hac[i-1])/2
end
hah = max.(hao, hac, matr[:,2])
hal = min.(hao, hac, matr[:,3])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant