mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
avoid emitting duplicated kline
This commit is contained in:
parent
b61af0db39
commit
b9b2b8727a
|
@ -391,7 +391,13 @@ var BacktestCmd = &cobra.Command{
|
|||
var numOfExchangeSources = len(exchangeSources)
|
||||
if numOfExchangeSources == 1 {
|
||||
exSource := exchangeSources[0]
|
||||
var lastk types.KLine
|
||||
for k := range exSource.C {
|
||||
// avoid duplicated klines
|
||||
if k == lastk {
|
||||
continue
|
||||
}
|
||||
|
||||
exSource.Exchange.ConsumeKLine(k)
|
||||
|
||||
for _, h := range kLineHandlers {
|
||||
|
|
Loading…
Reference in New Issue
Block a user