-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement custom deserializer for TradingPeriods
- Loading branch information
Showing
5 changed files
with
289 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#[cfg(not(feature = "blocking"))] | ||
use tokio_test; | ||
use yahoo_finance_api as yahoo; | ||
|
||
#[cfg(not(feature = "blocking"))] | ||
fn get_history() -> Result<yahoo::YResponse, yahoo::YahooError> { | ||
let provider = yahoo::YahooConnector::new(); | ||
tokio_test::block_on(provider.get_quote_period_interval("AAPL", "1d", "1m", true)) | ||
} | ||
|
||
#[cfg(feature = "blocking")] | ||
fn get_history() -> Result<yahoo::YResponse, yahoo::YahooError> { | ||
let provider = yahoo::YahooConnector::new(); | ||
provider.get_quote_history_interval("AAPL", "1d", "1m", true) | ||
} | ||
|
||
fn main() { | ||
let quote_history = get_history().unwrap(); | ||
//let times = quote_history.chart.result.timestamp; | ||
//let quotes = quote_history.indicators.quote.q | ||
println!("Quote history of VTI:\n{:#?}", quote_history); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters