Updated EngineConfig
This commit is contained in:
@@ -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}%"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user