refactor(ml): consolidate 13 duplicate OHLCVBar structs into canonical types module
Introduces ml/src/types/ohlcv.rs as the single source of truth for OHLCVBar (DateTime<Utc>, f64). Replaces 13 identical struct definitions scattered across features/, regime/, real_data_loader, and evaluation/. The f32 backtesting variant in evaluation/metrics.rs is renamed to OHLCVBarF32 to distinguish it from the canonical type. The regime_adx.rs i64-timestamp variant was safely migrated since its timestamp field was never accessed. The orchestrator's Bar alias is replaced with OHLCVBar. 39 files changed, -151 net lines removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,7 @@ impl TradingAgentServiceImpl {
|
||||
&self,
|
||||
symbol: &str,
|
||||
limit: i32,
|
||||
) -> Result<Vec<ml::regime::orchestrator::Bar>, Status> {
|
||||
) -> Result<Vec<ml::types::OHLCVBar>, Status> {
|
||||
let records = sqlx::query!(
|
||||
r#"
|
||||
SELECT open, close, high, low, volume, timestamp
|
||||
@@ -76,7 +76,7 @@ impl TradingAgentServiceImpl {
|
||||
let low = r.low? as f64 / 100.0;
|
||||
let volume = r.volume? as f64;
|
||||
|
||||
Some(ml::regime::orchestrator::Bar {
|
||||
Some(ml::types::OHLCVBar {
|
||||
timestamp: r.timestamp,
|
||||
open,
|
||||
high,
|
||||
|
||||
Reference in New Issue
Block a user