Open redstrike opened 4 years ago
Same for MACD
Probably because it's using EMA by default
@redstrike EMA looks correct. Depending on the parameters they can yield the same results or not.
Look at this example:
const SMA = require('technicalindicators').SMA
let period = 3;
let values = [1.5554, 1.5555, 1.5558,1.5560];
SMA.calculate({period : period, values : values})
const EMA = require('technicalindicators').EMA
let period = 3;
let values = [1.5554, 1.5555, 1.5558,1.5560];
EMA.calculate({period : period, values : values})
@juanvisoler I did an EMA calculation with a larger dataset before trying the above simple example and compare it with other true sources such as TradingView, and believe that EMA result is not accurate.
@redstrike can you give an example?
finmath's EMA result is more accurate as expected. Also, I compare the result with TradingView's calculated result, so I want to report this issue. If you believe that technicalindicators' EMA result is correct, then I have no more comment.
我用EMA计算的结果也是有问题哎
我用EMA计算的结果也是有问题哎
是我错了,当数据量较小时计算结果似乎不正确,但当数据量足够大时是没问题的,这个库非常棒
我用EMA计算的结果也是有问题哎
是我错了,当数据量较小时计算结果似乎不正确,但当数据量足够大时是没问题的,这个库非常棒
唯一的遗憾是只能nextValue不能updateCurrentValue
@anandanand84 can you please look into this issue please? looks like this is what's causing the issue in MACD(EMA based) as mentioned here: https://github.com/anandanand84/technicalindicators/issues/249#issuecomment-1321147767
Also comparing it to TradingView's EMA and seems incorrect
I am trying to calculate EMA and SMA of the same data values. However, the result is the same. When comparing to TradingView's calculated EMA, it's not matched.