pub struct BacktestCache {
pub version: u32,
pub fetched_at: DateTime<Utc>,
pub from: NaiveDate,
pub to: NaiveDate,
pub symbols: HashMap<String, Vec<StoredCandle>>,
}Fields§
§version: u32§fetched_at: DateTime<Utc>§from: NaiveDate§to: NaiveDate§symbols: HashMap<String, Vec<StoredCandle>>Implementations§
Source§impl BacktestCache
impl BacktestCache
pub fn new(from: NaiveDate, to: NaiveDate) -> Self
pub fn load(path: &Path) -> Result<Self>
pub fn save(&self, path: &Path) -> Result<()>
pub fn merge_history(&mut self, symbol: &str, candles: Vec<StoredCandle>)
pub fn ingest_schwab_history(&mut self, symbol: &str, history: &Value)
pub fn closes_through(&self, symbol: &str, day: NaiveDate) -> Vec<f64>
pub fn bar_on_date(&self, symbol: &str, day: NaiveDate) -> Option<&StoredCandle>
pub fn close_on_date(&self, symbol: &str, day: NaiveDate) -> Option<f64>
Sourcepub fn vix_on_date(&self, configured: &str, day: NaiveDate) -> Option<f64>
pub fn vix_on_date(&self, configured: &str, day: NaiveDate) -> Option<f64>
Prefer $VIX then VIX for the index level on day.
pub fn trading_days( &self, benchmark: &str, from: NaiveDate, to: NaiveDate, ) -> Result<Vec<NaiveDate>>
Trait Implementations§
Source§impl Clone for BacktestCache
impl Clone for BacktestCache
Source§fn clone(&self) -> BacktestCache
fn clone(&self) -> BacktestCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BacktestCache
impl Debug for BacktestCache
Source§impl<'de> Deserialize<'de> for BacktestCache
impl<'de> Deserialize<'de> for BacktestCache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BacktestCache
impl RefUnwindSafe for BacktestCache
impl Send for BacktestCache
impl Sync for BacktestCache
impl Unpin for BacktestCache
impl UnsafeUnpin for BacktestCache
impl UnwindSafe for BacktestCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more