1use std::collections::HashMap;
2
3use crate::model::candle::Candle;
4use crate::model::signal::Signal;
5use crate::model::tick::Tick;
6use crate::order_manager::{OrderHistorySnapshot, OrderUpdate};
7use crate::risk_module::RateBudgetSnapshot;
8
9#[derive(Debug, Clone)]
10pub enum WsConnectionStatus {
11 Connected,
12 Disconnected,
13 Reconnecting { attempt: u32, delay_ms: u64 },
14}
15
16#[derive(Debug, Clone)]
17pub enum AppEvent {
18 MarketTick(Tick),
19 StrategySignal {
20 signal: Signal,
21 source_tag: String,
22 price: Option<f64>,
23 timestamp_ms: u64,
24 },
25 StrategyState {
26 fast_sma: Option<f64>,
27 slow_sma: Option<f64>,
28 },
29 OrderUpdate(OrderUpdate),
30 WsStatus(WsConnectionStatus),
31 HistoricalCandles {
32 candles: Vec<Candle>,
33 interval_ms: u64,
34 interval: String,
35 },
36 BalanceUpdate(HashMap<String, f64>),
37 OrderHistoryUpdate(OrderHistorySnapshot),
38 RiskRateSnapshot {
39 global: RateBudgetSnapshot,
40 orders: RateBudgetSnapshot,
41 account: RateBudgetSnapshot,
42 market_data: RateBudgetSnapshot,
43 },
44 TickDropped,
45 LogMessage(String),
46 Error(String),
47}