Comments (3)
Created a PR for your consideration.
from ta-rs.
@virtualritz Hi!
Thanks for your comment, the suggestion you propose sounds reasonable, enforcing validation without giving any other options, indeed not the best idea. On other hand.. I did not expect people to use DataItem
extensively, they should rather come up with own implementations of "DateItem"s depending on their source of data (.e.g it's often that Volume
is missing).
Thanks for the PR. I will take a close look at it next week, when I'll have time.
It may be, that I'd go for multiple variations of data items, depending on data that are supplied.
from ta-rs.
Yet I need to build a complete DataItem using the builder() method.
You don't have to. DataItem
here is mostly for illustrative purpose and a little bit of convenience.
The indicators are designed not to rely on DataTime
, but rather on the abstractions (Close
, Low
, High
, etc traits).
I just added an example, please see: https://github.com/greyblake/ta-rs/blob/master/examples/custom_data_item.rs
It would be nice to be able to use the init struct pattern on DataItem
This pattern for this use case creates a lot of surfaces for potential errors. For example: you may initialize DataTime with only high
, and use TrueRange
indicator, which will pick 0
for low
and close
. This will of course will lead to incorrect output without any errors.
from ta-rs.
Related Issues (20)
- Any interest in serde support? HOT 2
- Feature request: Hull moving average HOT 3
- Give to Typical Price his own structure ? HOT 2
- Get rid of error-chain dependency.
- RSI value does NOT match expected values HOT 10
- DataItemIncomplete when trying to unwrap DataItem build HOT 2
- How to use special inputs like ohlc4? HOT 1
- ATR value doesn't match expected values HOT 1
- Would it be possible to limit the number of input values? HOT 2
- wonder how to handle big number, like for cryptocurrency HOT 1
- Feature request: Add support for `rust_decimal`. HOT 7
- Keeping track of number updates HOT 1
- Change `usize` to `std::num::NonZeroUsize` in `new()` methods
- Add DX/DMI & ADX HOT 2
- VolumeWeightAdjustedPrice (VWAP)
- [help]Test used times. HOT 1
- Failing regression tests from original TA Lib HOT 5
- Request Fractals Pattern Indicator
- Second/subsequent iterations of `EfficiencyRatio` is `NaN` when price is stationary.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ta-rs.