pub struct AppState {Show 63 fields
pub symbol: String,
pub strategy_label: String,
pub candles: Vec<Candle>,
pub current_candle: Option<CandleBuilder>,
pub candle_interval_ms: u64,
pub timeframe: String,
pub price_history_len: usize,
pub position: Position,
pub last_signal: Option<Signal>,
pub last_order: Option<OrderUpdate>,
pub open_order_history: Vec<String>,
pub filled_order_history: Vec<String>,
pub fast_sma: Option<f64>,
pub slow_sma: Option<f64>,
pub ws_connected: bool,
pub paused: bool,
pub tick_count: u64,
pub log_messages: Vec<String>,
pub balances: HashMap<String, f64>,
pub initial_equity_usdt: Option<f64>,
pub current_equity_usdt: Option<f64>,
pub history_estimated_total_pnl_usdt: Option<f64>,
pub fill_markers: Vec<FillMarker>,
pub history_trade_count: u32,
pub history_win_count: u32,
pub history_lose_count: u32,
pub history_realized_pnl: f64,
pub strategy_stats: HashMap<String, OrderHistoryStats>,
pub history_fills: Vec<OrderHistoryFill>,
pub last_price_update_ms: Option<u64>,
pub last_price_event_ms: Option<u64>,
pub last_price_latency_ms: Option<u64>,
pub last_order_history_update_ms: Option<u64>,
pub last_order_history_event_ms: Option<u64>,
pub last_order_history_latency_ms: Option<u64>,
pub trade_stats_reset_warned: bool,
pub symbol_selector_open: bool,
pub symbol_selector_index: usize,
pub symbol_items: Vec<String>,
pub strategy_selector_open: bool,
pub strategy_selector_index: usize,
pub strategy_items: Vec<String>,
pub account_popup_open: bool,
pub history_popup_open: bool,
pub focus_popup_open: bool,
pub strategy_editor_open: bool,
pub strategy_editor_index: usize,
pub strategy_editor_field: usize,
pub strategy_editor_symbol_index: usize,
pub strategy_editor_fast: usize,
pub strategy_editor_slow: usize,
pub strategy_editor_cooldown: u64,
pub v2_grid_symbol_index: usize,
pub v2_grid_strategy_index: usize,
pub history_rows: Vec<String>,
pub history_bucket: HistoryBucket,
pub last_applied_fee: String,
pub v2_grid_open: bool,
pub v2_state: AppStateV2,
pub rate_budget_global: RateBudgetSnapshot,
pub rate_budget_orders: RateBudgetSnapshot,
pub rate_budget_account: RateBudgetSnapshot,
pub rate_budget_market_data: RateBudgetSnapshot,
}Fields§
§symbol: String§strategy_label: String§candles: Vec<Candle>§current_candle: Option<CandleBuilder>§candle_interval_ms: u64§timeframe: String§price_history_len: usize§position: Position§last_signal: Option<Signal>§last_order: Option<OrderUpdate>§open_order_history: Vec<String>§filled_order_history: Vec<String>§fast_sma: Option<f64>§slow_sma: Option<f64>§ws_connected: bool§paused: bool§tick_count: u64§log_messages: Vec<String>§balances: HashMap<String, f64>§initial_equity_usdt: Option<f64>§current_equity_usdt: Option<f64>§history_estimated_total_pnl_usdt: Option<f64>§fill_markers: Vec<FillMarker>§history_trade_count: u32§history_win_count: u32§history_lose_count: u32§history_realized_pnl: f64§strategy_stats: HashMap<String, OrderHistoryStats>§history_fills: Vec<OrderHistoryFill>§last_price_update_ms: Option<u64>§last_price_event_ms: Option<u64>§last_price_latency_ms: Option<u64>§last_order_history_update_ms: Option<u64>§last_order_history_event_ms: Option<u64>§last_order_history_latency_ms: Option<u64>§trade_stats_reset_warned: bool§symbol_selector_open: bool§symbol_selector_index: usize§symbol_items: Vec<String>§strategy_selector_open: bool§strategy_selector_index: usize§strategy_items: Vec<String>§account_popup_open: bool§history_popup_open: bool§focus_popup_open: bool§strategy_editor_open: bool§strategy_editor_index: usize§strategy_editor_field: usize§strategy_editor_symbol_index: usize§strategy_editor_fast: usize§strategy_editor_slow: usize§strategy_editor_cooldown: u64§v2_grid_symbol_index: usize§v2_grid_strategy_index: usize§history_rows: Vec<String>§history_bucket: HistoryBucket§last_applied_fee: String§v2_grid_open: bool§v2_state: AppStateV2§rate_budget_global: RateBudgetSnapshot§rate_budget_orders: RateBudgetSnapshot§rate_budget_account: RateBudgetSnapshot§rate_budget_market_data: RateBudgetSnapshotImplementations§
Source§impl AppState
impl AppState
pub fn new( symbol: &str, strategy_label: &str, price_history_len: usize, candle_interval_ms: u64, timeframe: &str, ) -> Self
Sourcepub fn last_price(&self) -> Option<f64>
pub fn last_price(&self) -> Option<f64>
Get the latest price (from current candle or last finalized candle).
pub fn push_log(&mut self, msg: String)
pub fn refresh_history_rows(&mut self)
pub fn apply(&mut self, event: AppEvent)
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe for AppState
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> 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