use hypersdk::hypercore::Side; use rust_decimal::Decimal; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub enum MarketTrend { Bullish, Bearish, Neutral, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub enum LogKind { Info, Warn, Err, Debug, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct Signal { pub symbol: String, pub side: Side, pub confidence: f32, pub entry_price: Decimal, pub take_profit: Decimal, pub stop_loss: Decimal, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct EventLog { pub kind: LogKind, pub name: String, pub message: String, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct Position { pub symbol: String, pub size: Decimal, pub entry_price: Decimal, pub pnl: Decimal, } impl std::fmt::Display for MarketTrend { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Bullish => write!(f, "Bullish"), Self::Bearish => write!(f, "Bearish"), Self::Neutral => write!(f, "Neutral"), } } } impl std::fmt::Display for LogKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Info => write!(f, "INFO"), Self::Warn => write!(f, "WARN"), Self::Err => write!(f, "ERR"), Self::Debug => write!(f, "DEBUG"), } } }