Skip to main content

AppState

Struct AppState 

Source
pub struct AppState {
Show 106 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 log_records: Vec<LogRecord>, 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 portfolio_state: PortfolioStateSnapshot, pub strategy_stats: HashMap<String, OrderHistoryStats>, pub exit_policy_by_scope: HashMap<String, ExitPolicyEntry>, pub predictor_metrics_by_scope: HashMap<String, PredictorMetricEntry>, 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 strategy_item_symbols: Vec<String>, pub strategy_item_active: Vec<bool>, pub strategy_item_created_at_ms: Vec<i64>, pub strategy_item_total_running_ms: Vec<u64>, pub account_popup_open: bool, pub history_popup_open: bool, pub focus_popup_open: bool, pub close_all_confirm_open: bool, pub strategy_editor_open: bool, pub strategy_editor_kind_category_selector_open: bool, pub strategy_editor_kind_selector_open: bool, pub strategy_editor_index: usize, pub strategy_editor_field: usize, pub strategy_editor_kind_category_items: Vec<String>, pub strategy_editor_kind_category_index: usize, pub strategy_editor_kind_popup_items: Vec<String>, pub strategy_editor_kind_popup_labels: Vec<Option<String>>, pub strategy_editor_kind_items: Vec<String>, pub strategy_editor_kind_selector_index: usize, pub strategy_editor_kind_index: usize, pub strategy_editor_symbol_index: usize, pub strategy_editor_fast: usize, pub strategy_editor_slow: usize, pub strategy_editor_cooldown: u64, pub grid_symbol_index: usize, pub grid_strategy_index: usize, pub grid_select_on_panel: bool, pub grid_tab: GridTab, pub strategy_last_event_by_tag: HashMap<String, StrategyLastEvent>, pub network_tick_drop_count: u64, pub network_reconnect_count: u64, pub network_tick_latencies_ms: Vec<u64>, pub network_fill_latencies_ms: Vec<u64>, pub network_order_sync_latencies_ms: Vec<u64>, pub network_tick_in_timestamps_ms: Vec<u64>, pub network_tick_drop_timestamps_ms: Vec<u64>, pub network_reconnect_timestamps_ms: Vec<u64>, pub network_disconnect_timestamps_ms: Vec<u64>, pub network_last_fill_ms: Option<u64>, pub network_pending_submit_ms_by_intent: HashMap<String, u64>, pub history_rows: Vec<String>, pub history_bucket: HistoryBucket, pub last_applied_fee: String, pub grid_open: bool, pub ui_projection: UiProjection, pub rate_budget_global: RateBudgetSnapshot, pub rate_budget_orders: RateBudgetSnapshot, pub rate_budget_account: RateBudgetSnapshot, pub rate_budget_market_data: RateBudgetSnapshot, pub close_all_running: bool, pub close_all_job_id: Option<u64>, pub close_all_total: usize, pub close_all_completed: usize, pub close_all_failed: usize, pub close_all_current_symbol: Option<String>, pub close_all_status_expire_at_ms: Option<u64>, pub close_all_row_status_by_symbol: HashMap<String, String>, pub hide_small_positions: bool, pub hide_empty_predictor_rows: bool, pub predictor_scroll_offset: usize,
}

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>§log_records: Vec<LogRecord>§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§portfolio_state: PortfolioStateSnapshot§strategy_stats: HashMap<String, OrderHistoryStats>§exit_policy_by_scope: HashMap<String, ExitPolicyEntry>§predictor_metrics_by_scope: HashMap<String, PredictorMetricEntry>§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>§strategy_item_symbols: Vec<String>§strategy_item_active: Vec<bool>§strategy_item_created_at_ms: Vec<i64>§strategy_item_total_running_ms: Vec<u64>§account_popup_open: bool§history_popup_open: bool§focus_popup_open: bool§close_all_confirm_open: bool§strategy_editor_open: bool§strategy_editor_kind_category_selector_open: bool§strategy_editor_kind_selector_open: bool§strategy_editor_index: usize§strategy_editor_field: usize§strategy_editor_kind_category_items: Vec<String>§strategy_editor_kind_category_index: usize§strategy_editor_kind_popup_items: Vec<String>§strategy_editor_kind_popup_labels: Vec<Option<String>>§strategy_editor_kind_items: Vec<String>§strategy_editor_kind_selector_index: usize§strategy_editor_kind_index: usize§strategy_editor_symbol_index: usize§strategy_editor_fast: usize§strategy_editor_slow: usize§strategy_editor_cooldown: u64§grid_symbol_index: usize§grid_strategy_index: usize§grid_select_on_panel: bool§grid_tab: GridTab§strategy_last_event_by_tag: HashMap<String, StrategyLastEvent>§network_tick_drop_count: u64§network_reconnect_count: u64§network_tick_latencies_ms: Vec<u64>§network_fill_latencies_ms: Vec<u64>§network_order_sync_latencies_ms: Vec<u64>§network_tick_in_timestamps_ms: Vec<u64>§network_tick_drop_timestamps_ms: Vec<u64>§network_reconnect_timestamps_ms: Vec<u64>§network_disconnect_timestamps_ms: Vec<u64>§network_last_fill_ms: Option<u64>§network_pending_submit_ms_by_intent: HashMap<String, u64>§history_rows: Vec<String>§history_bucket: HistoryBucket§last_applied_fee: String§grid_open: bool§ui_projection: UiProjection§rate_budget_global: RateBudgetSnapshot§rate_budget_orders: RateBudgetSnapshot§rate_budget_account: RateBudgetSnapshot§rate_budget_market_data: RateBudgetSnapshot§close_all_running: bool§close_all_job_id: Option<u64>§close_all_total: usize§close_all_completed: usize§close_all_failed: usize§close_all_current_symbol: Option<String>§close_all_status_expire_at_ms: Option<u64>§close_all_row_status_by_symbol: HashMap<String, String>§hide_small_positions: bool§hide_empty_predictor_rows: bool§predictor_scroll_offset: usize

Implementations§

Source§

impl AppState

Source

pub fn new( symbol: &str, strategy_label: &str, price_history_len: usize, candle_interval_ms: u64, timeframe: &str, ) -> Self

Source

pub fn last_price(&self) -> Option<f64>

Get the latest price (from current candle or last finalized candle).

Source

pub fn push_log(&mut self, msg: String)

Source

pub fn push_log_record(&mut self, record: LogRecord)

Source

pub fn view_state(&self) -> ViewState

Transitional projection for RFC-0016 Phase 2. Keeps runtime behavior unchanged while exposing normalized naming.

Source

pub fn is_grid_open(&self) -> bool

Source

pub fn set_grid_open(&mut self, open: bool)

Source

pub fn grid_tab(&self) -> GridTab

Source

pub fn set_grid_tab(&mut self, tab: GridTab)

Source

pub fn selected_grid_symbol_index(&self) -> usize

Source

pub fn set_selected_grid_symbol_index(&mut self, idx: usize)

Source

pub fn selected_grid_strategy_index(&self) -> usize

Source

pub fn set_selected_grid_strategy_index(&mut self, idx: usize)

Source

pub fn is_on_panel_selected(&self) -> bool

Source

pub fn set_on_panel_selected(&mut self, selected: bool)

Source

pub fn predictor_scroll_offset(&self) -> usize

Source

pub fn set_predictor_scroll_offset(&mut self, offset: usize)

Source

pub fn is_symbol_selector_open(&self) -> bool

Source

pub fn set_symbol_selector_open(&mut self, open: bool)

Source

pub fn symbol_selector_index(&self) -> usize

Source

pub fn set_symbol_selector_index(&mut self, idx: usize)

Source

pub fn is_strategy_selector_open(&self) -> bool

Source

pub fn set_strategy_selector_open(&mut self, open: bool)

Source

pub fn strategy_selector_index(&self) -> usize

Source

pub fn set_strategy_selector_index(&mut self, idx: usize)

Source

pub fn is_account_popup_open(&self) -> bool

Source

pub fn set_account_popup_open(&mut self, open: bool)

Source

pub fn is_history_popup_open(&self) -> bool

Source

pub fn set_history_popup_open(&mut self, open: bool)

Source

pub fn is_focus_popup_open(&self) -> bool

Source

pub fn set_focus_popup_open(&mut self, open: bool)

Source

pub fn is_close_all_confirm_open(&self) -> bool

Source

pub fn set_close_all_confirm_open(&mut self, open: bool)

Source

pub fn is_close_all_running(&self) -> bool

Source

pub fn close_all_status_text(&self) -> Option<String>

Source

pub fn is_strategy_editor_open(&self) -> bool

Source

pub fn set_strategy_editor_open(&mut self, open: bool)

Source

pub fn focus_symbol(&self) -> Option<&str>

Source

pub fn focus_strategy_id(&self) -> Option<&str>

Source

pub fn set_focus_symbol(&mut self, symbol: Option<String>)

Source

pub fn set_focus_strategy_id(&mut self, strategy_id: Option<String>)

Source

pub fn focus_pair(&self) -> (Option<String>, Option<String>)

Source

pub fn assets_view(&self) -> &[AssetEntry]

Source

pub fn refresh_history_rows(&mut self)

Source

pub fn apply(&mut self, event: AppEvent)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more