Closed rdbuf closed 5 years ago
It should be noted though, there is a possibility of a div-by-zero in case high - low = 0
that won't probably ever happen. In either case, I have not found any good solution to this.
there is a possibility of a div-by-zero in case
high - low = 0
It's actually not so uncommon for data sets to have zero range days where o=h=l=c. I'm not opposed to returning NaN in general, but in this case it seems better to have AD
evaluate to zero in the case of high - low = 0
. I would like to see that case handled.
Take a look at ad.c
, and see how it handles the same case. ta-lib also treats high - low = 0
as a zero for their AD implementation.
This is a very good PR, by the way. It has all the info I want to see - very clean. Great work!
Yes, it sounds totally reasonable to me. I've updated the PR.
Thanks for your appreciation :)
The source is Kirkpatrick, Dahlquist. Technical Analysis: The Complete Resource for Financial Market Technicians (2 ed.), ISBN 978-0-13-705944-7. pp. 419, 421
The implementation literally follows the description: 1) Chaikin Money Flow 2) Chaikin AD