-
Notifications
You must be signed in to change notification settings - Fork 129
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
Failing regression tests from original TA Lib #70
Comments
I believe the issue is how TA-Lib calculates the EMA by default using the TA_MA_CLASSIC technique, where as ta-rs uses TA_MA_METASTOCK. With TA-Lib the implementation requires the size of the data to be In ta-rs the period is only used to calculate If you wanted to replicate what is expected from TA-Lib, you need to calculate the MA for |
So the action to take here is to add a note to the docs about |
Not sure, I only came across this library today to see what TA crates exist and was looking at the issues they had open. Your comment led me to looking up the actual TA-Lib definitions and diving into this crates source. Seeing how there are pull requests from March 2022, not sure if any changes will get merged anytime soon. Also note, CorporateFinanceInstitute, Investopedia, and Statology (in R) list calculating the SMA for the first seed then use the EMA algorithm ta-rs uses to calculate additional data points. |
Much appreciated on the update! I went ahead and created my own TA library implementation a few months ago after your discovery of this issue and have been using that. Excited to see this project move forward though, it's a great library. |
See subject.
I started doing this here. I only added tests for SMA and EMA. SMA works, i.e. the SMA of
ta-rs
matches the SMA output ofTA Lib
1:1. But for EMA it fails.There are two options: I am doing something wrong or the EMA implementation in
ta-rs
has a bug. I'm just opening this issue here to get some opinions.The code I copied for data.rs is from test_data.c.
The actual tests are vastly simplified from the ones in
TA Lib
. I.e. I only run the iterator for the resp. indicator n times and compare the result with the expected one. See here.The text was updated successfully, but these errors were encountered: