-
Notifications
You must be signed in to change notification settings - Fork 139
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
Feature request: Add support for rust_decimal
.
#55
Comments
@lukesneeringer Hi. |
My reason is basically the same as the one in #15: I am trying to avoid the use of floats; every number in the project is an integer or a decimal. I agree that for many of the outputs of I also expect this can be done in a reasonably generic way to not add very much code duplication. |
Decimals important for storing money and making operations with money, I do agree. But this does not apply to technical analysis.
You can implement a wrapper around the existing indactors, that would convert f64 -> Decimal. But generally I would suggest.. just convert the values where you want to do comparison. Moving averages, is probably the only case when you actually want to compare prices with indicator values. |
It is not so much that I think the precision of decimals is critical in this case. I am much more interested in API simplicity. I want my folks to work with decimals all the time rather than having to take on converting between decimals and floats. |
@greyblake Following up on this, because it's still something I am hoping for. I'm willing to implement it myself, but I don't want to do it if you're going to reject the PR. :-) I'd do it behind a feature gate, so it won't affect anyone who doesn't want it. |
@lukesneeringer Hi, thanks for reaching me. Unfortunately I don't have much spare time at the moment to dedicate to |
That's fair. I think I know how this should be done that would work well. I'll send you a PR. |
It would be nice to be able to use
rust_decimal.Decimal
and not lose the precision off64
. I would be willing in principle to contribute this if you think you would accept it.The text was updated successfully, but these errors were encountered: