mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
fix: show error message when aggTrade is used in backtesting
This commit is contained in:
parent
e021cdd060
commit
d247e1cb97
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/c9s/bbgo/pkg/fixedpoint"
|
||||
"github.com/c9s/bbgo/pkg/types"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type SerialMarketDataStore struct {
|
||||
|
@ -44,6 +45,11 @@ func (store *SerialMarketDataStore) Subscribe(interval types.Interval) {
|
|||
|
||||
func (store *SerialMarketDataStore) BindStream(ctx context.Context, stream types.Stream) {
|
||||
if store.UseAggTrade {
|
||||
if IsBackTesting {
|
||||
log.Errorf("Right now in backtesting, aggTrade event is not yet supported. Use OnKLineClosed instead.")
|
||||
stream.OnKLineClosed(store.handleKLineClosed)
|
||||
return
|
||||
}
|
||||
go store.tickerProcessor(ctx)
|
||||
stream.OnAggTrade(store.handleMarketTrade)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user