Skip to content
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

Decimal support? #15

Closed
jgarzik opened this issue Oct 20, 2019 · 3 comments
Closed

Decimal support? #15

jgarzik opened this issue Oct 20, 2019 · 3 comments

Comments

@jgarzik
Copy link

jgarzik commented Oct 20, 2019

Is it possible to plug in more accurate decimal types, such as https://github.com/paupino/rust-decimal ?

@greyblake
Copy link
Owner

Maybe.
Definition of Next trait is quite abstract:

pub trait Next<T> {
    type Output;
    fn next(&mut self, input: T) -> Self::Output;
}

But why accuracy of f64 is not enough for your case?

@jgarzik
Copy link
Author

jgarzik commented Oct 20, 2019

It's a no-floating-point project requirement (standard in certain financial software).

@greyblake
Copy link
Owner

I can understand this requirement for money transactions, accounting, etc.., But for technical analysis indicators it would not make much sense.

Some indicators (.e.g. EMA) really depend on seed data and initial state. This often differ from implementation to implementation. With reasonable amount data fed, different implementation would show more or less same result (but not absolutely equal with crazy engineering precision)

My point: this is not a reasonable requirement for TA indicators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants