diff --git a/src/blocking_impl.rs b/src/blocking_impl.rs index b384d3a..63bba3f 100644 --- a/src/blocking_impl.rs +++ b/src/blocking_impl.rs @@ -54,6 +54,27 @@ impl YahooConnector { YResponse::from_json(self.send_request(&url)?) } + /// Retrieve the quote history for the given ticker form date start to end (inclusive) and optionally before and after regular trading hours, if available; specifying the interval of the ticker. + pub fn get_quote_history_interval_prepost( + &self, + ticker: &str, + start: OffsetDateTime, + end: OffsetDateTime, + interval: &str, + prepost: bool, + ) -> Result { + let url = format!( + YCHART_PERIOD_QUERY_PRE_POST!(), + url = self.url, + symbol = ticker, + start = start.unix_timestamp(), + end = end.unix_timestamp(), + interval = interval, + prepost = prepost, + ); + YResponse::from_json(self.send_request(&url)?) + } + /// Retrieve the quote history for the given ticker for a given period and ticker interval and optionally before and after regular trading hours pub fn get_quote_period_interval( &self,