Format related strategy and test files

This commit is contained in:
boris
2026-04-22 23:36:56 -07:00
parent ea2871a0f2
commit c4967c3711
4 changed files with 35 additions and 45 deletions

View File

@@ -178,11 +178,7 @@ impl CnSmallCapRotationStrategy {
let (sum, count) = window.fold((0.0, 0usize), |(sum, count), value| {
(sum + value, count + 1)
});
if count == 0 {
0.0
} else {
sum / count as f64
}
if count == 0 { 0.0 } else { sum / count as f64 }
}
fn gross_exposure(&self, closes: &[f64]) -> f64 {
@@ -332,7 +328,7 @@ impl Strategy for CnSmallCapRotationStrategy {
order_intents: Vec::new(),
notes: vec![format!("warmup: {}", message)],
diagnostics: vec![
"insufficient history; skip trading on warmup dates".to_string()
"insufficient history; skip trading on warmup dates".to_string(),
],
});
}
@@ -628,11 +624,7 @@ impl JqMicroCapStrategy {
0
} else {
let next = quantity.saturating_sub(order_step_size.max(1));
if next < minimum {
0
} else {
next
}
if next < minimum { 0 } else { next }
}
}
@@ -1538,7 +1530,7 @@ impl Strategy for JqMicroCapStrategy {
order_intents: Vec::new(),
notes: vec![format!("warmup: {}", message)],
diagnostics: vec![
"insufficient history; skip trading on warmup dates".to_string()
"insufficient history; skip trading on warmup dates".to_string(),
],
});
}