Tidy up
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::{
|
||||
general::{EventLog, MarketTrend, Position, Signal},
|
||||
general::{EventLog, Position, Signal},
|
||||
strategy::StrategyManifest,
|
||||
units::{Symbol, USD, Volatility},
|
||||
};
|
||||
use hypersdk::{Decimal, hypercore::CandleInterval};
|
||||
|
||||
@@ -39,37 +38,10 @@ pub enum TerminalClientMessage {
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct MarketItem {
|
||||
pub symbol: Symbol,
|
||||
pub price: USD,
|
||||
pub symbol: String,
|
||||
pub price: Decimal,
|
||||
pub trend: Decimal,
|
||||
pub volume_24h: USD,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct MarketOverview {
|
||||
pub trend: MarketTrend,
|
||||
pub volatility: Volatility,
|
||||
pub pressure: f64,
|
||||
pub alerts: Vec<Alert>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum AlertLevel {
|
||||
High,
|
||||
Medium,
|
||||
Low,
|
||||
}
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Alert {
|
||||
pub level: AlertLevel,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Balance {
|
||||
pub asset: String,
|
||||
pub amount: f64,
|
||||
pub value: f64,
|
||||
pub volume_24h: Decimal,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
@@ -116,16 +88,6 @@ pub struct Strategy {
|
||||
pub cooldown: CandleInterval,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for AlertLevel {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::High => write!(f, "H"),
|
||||
Self::Medium => write!(f, "M"),
|
||||
Self::Low => write!(f, "L"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Mode {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user