pub struct Context<'a> {
pub portfolio: &'a Portfolio,
pub candle_index: usize,
pub current_price: f64,
}Expand description
Read-only view of engine state passed to the strategy each bar.
Fields§
§portfolio: &'a PortfolioSnapshot of the portfolio at the start of this bar (post-prior-bar updates).
candle_index: usizeZero-based index of the current bar within the input slice.
current_price: f64Close of the current bar — the price at which any orders this bar will fill.
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
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