typed Syntax and improved formatting

This commit is contained in:
2026-07-25 04:30:58 +02:00
parent 6b6085ef25
commit f615d8dfbb
7 changed files with 147 additions and 87 deletions
+10 -8
View File
@@ -1,6 +1,9 @@
use pulse_macros::pwp;
use crate::PulseWire;
use crate::{
PulseWire,
units::{Symbol, USD},
};
#[pwp]
pub enum MarketTrend {
@@ -28,9 +31,9 @@ pub struct Signal {
pub kind: Direction,
pub confidence: f32,
pub size: f64,
pub price: f64,
pub take_profit: f64,
pub take_stop_loss: f64,
pub price: USD,
pub take_profit: USD,
pub stop_loss: USD,
}
#[pwp]
@@ -50,10 +53,10 @@ pub struct EventLog {
#[pwp]
pub struct Position {
pub symbol: String,
pub symbol: Symbol,
pub size: f64,
pub entry_price: f64,
pub profit: f64,
pub entry_price: USD,
pub profit: USD,
}
impl std::fmt::Display for Direction {
@@ -65,7 +68,6 @@ impl std::fmt::Display for Direction {
}
}
impl std::fmt::Display for MarketTrend {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {