Giter VIP home page Giter VIP logo

yahoo-finance-rs's People

Contributors

fbriden avatar kdar avatar kov avatar teohhanhui avatar xemwebe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yahoo-finance-rs's Issues

README docs are outdated

The main README.md needs to be updated to reflect that the historical functions are now async

Realtime Interface

We need a way to get realtime ticker updates from Yahoo over websockets. The API needs to be able to add and remove listeners for ticker symbols. When a new message comes over websockets indicating something has changed for the ticker symbol a callback for the symbol needs to be called so work can be done.

Support negative timestamps

If I understand correctly, here we use u64 to hold the timestamp, which obviously doesn't work if the timestamp is negative (before 1970-01-01T00:00:00Z):

ez_serde!(Data { meta: Meta, #[serde(rename = "timestamp")] timestamps: Vec<u64>, indicators: Indicators });

So it needs to be changed to i64.

Profile Information

We need an API to get profile information on a company, based on the symbol. Look for information like, sector, industry, description, name, address, etc

return Result instead of panic

Hi, thank's for writing this little library, saves me from doing it myself... ;-)

However, I observed that for some valid ticker, the library panics, crashing my application which is based on it. Here is an example:

use yahoo_finance::history;
use std::time::{Duration, UNIX_EPOCH};
use chrono::{DateTime,Utc};

fn main() {
   let data = history::retrieve("ISPFF").unwrap();
   for bar in &data {
      println!("On {} ISPFF closes at ${:.2}", 
          DateTime::<Utc>::from(UNIX_EPOCH + Duration::from_secs(bar.timestamp)), bar.close)
   }
}

Apparently, the cause is that yahoo delivers a null value in field firstTradeDate, which causes the unwrap in line 31 of chart.rs to panic:

let response: Response = serde_json::from_str(x).unwrap();

Could you consider to return a Result instead of letting the library panic? In this case, the application calling the library could decide how to deal with it. Of course, you could just avoid using these ticker (which is recommended anyway since yahoo delivers only sparse data for that one), but I would prefer if I could check that without testing for panic.

Historical Data

We need an API to retrieve the OHLCV data for a period of time. The API needs to accept a ticker symbol, an optional interval (defaulting to 3 months) and an optional end date - where the final range will be between start date & end date where start date is end date - interval. The API needs to use a std::Result so that an error can be returned if one occurs

Refactor tests

I really need to mock out the yahoo calls to harden against error cases

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.