Expose futures account runtime view
This commit is contained in:
@@ -353,6 +353,7 @@ impl FuturesPosition {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FuturesAccountState {
|
||||
starting_cash: f64,
|
||||
total_cash: f64,
|
||||
frozen_cash: f64,
|
||||
positions: BTreeMap<(String, FuturesDirection), FuturesPosition>,
|
||||
@@ -361,12 +362,17 @@ pub struct FuturesAccountState {
|
||||
impl FuturesAccountState {
|
||||
pub fn new(total_cash: f64) -> Self {
|
||||
Self {
|
||||
starting_cash: total_cash,
|
||||
total_cash,
|
||||
frozen_cash: 0.0,
|
||||
positions: BTreeMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn starting_cash(&self) -> f64 {
|
||||
self.starting_cash
|
||||
}
|
||||
|
||||
pub fn total_cash(&self) -> f64 {
|
||||
self.total_cash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user