Updated EngineConfig

This commit is contained in:
2026-08-01 19:58:10 +02:00
parent 32b93ce2a5
commit a56b0004cf
6 changed files with 34 additions and 10 deletions
+9
View File
@@ -170,3 +170,12 @@ impl Allocation {
}
}
}
impl std::fmt::Display for Allocation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Fixed(v) => write!(f, "${v}"),
Self::Percent(p) => write!(f, "{p}%"),
}
}
}
+5 -1
View File
@@ -1,5 +1,5 @@
use crate::{
general::{EngineStatus, EventLog, Position, Signal},
general::{Allocation, EngineStatus, EventLog, Position, Signal},
strategy::StrategyManifest,
};
use hypersdk::Decimal;
@@ -65,4 +65,8 @@ pub enum InspectItem {
pub struct EngineConfig {
pub preset: String,
pub strategy: StrategyManifest,
pub risk_per_trade: Allocation,
pub max_open_positions: u32,
pub max_daily_loss: Allocation,
}