Giter VIP home page Giter VIP logo

Comments (3)

virtualritz avatar virtualritz commented on May 19, 2024

Created a PR for your consideration.

from ta-rs.

greyblake avatar greyblake commented on May 19, 2024

@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.

greyblake avatar greyblake commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.