Alexander Trufanov
Alexander Trufanov
> I also got different results with ATR. However, both the trueRange and SMA function work correctly but the ATR doesn't have the correct number. (I calculated manually to verify...
> ATR is calculated with SMA Why it's calculated with SMA?
> ADX is calculated with modified MA instead of SMA as I showed you above. And I said I suspect your modified MA is wrong too, but didn't compared them...
You will change the ATR calculation, and it will not match the TA-Lib's resultrs anyway, bcs your MMA might be wrong. That's what I would expect. Let's fix ATR, and...
does atr results match ta-lib's atr now?
> I currently don't have the python lib now. I guess the results should match now for ATR. No, they are still wrong: ``` import {TALib} from "../index"; describe('testing index...
Ok, I can confirm that ATR is fixed now. Well, I need to check adx...
I'm looking at DM calculation here: https://github.com/paris0120/talib.ts/blob/dev/src/index.ts#L396 it seems it conditionally multiplies pdm and ndm. But I believe it should conditionally sum them instead. Could you doeublecheck?
I'm not getting the typescript code then: ``` let up = h.subtract(h.lag(1)); let down = l.lag(1).subtract(l); ``` This seems to be `up[i] = h[i] - h[i-1]` and `down[i] = l[i-1]...
@mrjbq7 > are we wondering if TA-Lib has a bug, or are we trying to figure out why this typescript implementation is buggy? We don't know yet. > As pdm...