Fix GetCandlestick
This commit is contained in:
@@ -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?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user