mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 00:05:15 +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)
|
var numOfExchangeSources = len(exchangeSources)
|
||||||
if numOfExchangeSources == 1 {
|
if numOfExchangeSources == 1 {
|
||||||
exSource := exchangeSources[0]
|
exSource := exchangeSources[0]
|
||||||
|
var lastk types.KLine
|
||||||
for k := range exSource.C {
|
for k := range exSource.C {
|
||||||
|
// avoid duplicated klines
|
||||||
|
if k == lastk {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
exSource.Exchange.ConsumeKLine(k)
|
exSource.Exchange.ConsumeKLine(k)
|
||||||
|
|
||||||
for _, h := range kLineHandlers {
|
for _, h := range kLineHandlers {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user