diff --git a/pkg/bbgo/config.go b/pkg/bbgo/config.go index 16ddbdd9e..a54d3a4d5 100644 --- a/pkg/bbgo/config.go +++ b/pkg/bbgo/config.go @@ -12,7 +12,6 @@ import ( "github.com/pkg/errors" "gopkg.in/yaml.v3" - "github.com/c9s/bbgo/pkg/datasource/csvsource" "github.com/c9s/bbgo/pkg/datatype" "github.com/c9s/bbgo/pkg/dynamic" "github.com/c9s/bbgo/pkg/fixedpoint" @@ -151,8 +150,8 @@ type Backtest struct { Sessions []string `json:"sessions" yaml:"sessions"` // sync 1 second interval KLines - SyncSecKLines bool `json:"syncSecKLines,omitempty" yaml:"syncSecKLines,omitempty"` - CsvSource *csvsource.CsvConfig `json:"csvConfig,omitempty" yaml:"csvConfig,omitempty"` + SyncSecKLines bool `json:"syncSecKLines,omitempty" yaml:"syncSecKLines,omitempty"` + CsvSource *CsvSourceConfig `json:"csvConfig,omitempty" yaml:"csvConfig,omitempty"` } func (b *Backtest) GetAccount(n string) BacktestAccount { @@ -708,3 +707,8 @@ func reUnmarshal(conf interface{}, tpe interface{}) (interface{}, error) { return val.Elem().Interface(), nil } + +type CsvSourceConfig struct { + Market types.MarketType `json:"market"` + Granularity types.MarketDataType `json:"granularity"` +} diff --git a/pkg/datasource/csvsource/types.go b/pkg/datasource/csvsource/types.go index 215889c0d..eceb3620f 100644 --- a/pkg/datasource/csvsource/types.go +++ b/pkg/datasource/csvsource/types.go @@ -5,11 +5,6 @@ import ( "github.com/c9s/bbgo/pkg/types" ) -type CsvConfig struct { - Market types.MarketType `json:"market"` - Granularity types.MarketDataType `json:"granularity"` -} - type CsvTick struct { Exchange types.ExchangeName `json:"exchange"` Market types.MarketType `json:"market"`