diff --git a/stochastic-rs-quant/src/yahoo.rs b/stochastic-rs-quant/src/yahoo.rs index cb4acf2..67aff15 100644 --- a/stochastic-rs-quant/src/yahoo.rs +++ b/stochastic-rs-quant/src/yahoo.rs @@ -81,13 +81,13 @@ impl<'a> Yahoo<'a> { let history = res.quotes().unwrap(); let df = df!( - "timestamp" => Series::new("timestamp".into(), &history.iter().map(|r| r.timestamp / 86_400).collect::>()).cast(&DataType::Date).unwrap(), - "volume" => &history.iter().map(|r| r.volume).collect::>(), - "open" => &history.iter().map(|r| r.open).collect::>(), - "high" => &history.iter().map(|r| r.high).collect::>(), - "low" => &history.iter().map(|r| r.low).collect::>(), - "close" => &history.iter().map(|r| r.close).collect::>(), - "adjclose" => &history.iter().map(|r| r.adjclose).collect::>(), + "timestamp" => Series::new("timestamp".into(), &history.iter().map(|h| h.timestamp / 86_400).collect::>()).cast(&DataType::Date).unwrap(), + "volume" => &history.iter().map(|h| h.volume).collect::>(), + "open" => &history.iter().map(|h| h.open).collect::>(), + "high" => &history.iter().map(|h| h.high).collect::>(), + "low" => &history.iter().map(|h| h.low).collect::>(), + "close" => &history.iter().map(|h| h.close).collect::>(), + "adjclose" => &history.iter().map(|h| h.adjclose).collect::>(), ) .unwrap();