Fix GetCandlestick

This commit is contained in:
2026-07-28 20:13:34 +02:00
parent fca09449b5
commit 1fb2ab9f2b
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -106,7 +106,7 @@ impl StrategyEngine {
}
}
Some(StrategyMessage::RequestCandlestick {
Some(StrategyMessage::GetCandlestick {
symbol,
interval,
count,
@@ -118,6 +118,8 @@ impl StrategyEngine {
.unwrap()
.as_millis() as u64;
println!("getting candlestick");
let interval_ms = match interval {
CandleInterval::OneMinute => 60_000,
CandleInterval::ThreeMinutes => 3 * 60_000,
@@ -137,8 +139,14 @@ impl StrategyEngine {
let start_time = now.saturating_sub(interval_ms * count as u64);
client
.candle_snapshot(symbol, interval, start_time, now)
self.strategy
.send(&StrategyEngineMessage::Candlestick {
candles: client
.candle_snapshot(&symbol, interval, start_time, now)
.await?,
symbol,
interval,
})
.await?;
}
}