-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
General Indicator Miscalculations #50
Comments
Described problem does not exists. May be you can get some wrong values, but is not worked as you described. We have miscalculations but it's very very very small, that the machine precision error. It's especially visible on big integer numbers. It still ignored by me. Because does not produce visible deviations for strategies. Especially if we need to have high boost for performance, its a pay for highload.
|
You can find more details here |
Check the test here please https://github.com/debut-js/Indicators/pull/53/files |
I have added the test for the difference between BigFloat (floating error fixed) and with native number SMA calculations. Here is the difference for 900_000 calculations. I create a new issue with that #54 |
I will close that issue because no activity |
Calculating the SMA20 of a dataset/series like 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 will result in 21.4 (previous last 20.4). But the real correct result should have been 20.5, if we consider the official mathematical formula of calculating a SMA (verified by investopedia, tradingview, other indicators, ..). The same problems happens on the EMA calculation (with a much worse result) the last time I checked (this might apply to other indicators as well).
The text was updated successfully, but these errors were encountered: