bbgo: move CsvConfig to bbgo package

This commit is contained in:
c9s 2023-12-14 15:49:08 +08:00
parent 4d84308b99
commit dae140aacc
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 7 additions and 8 deletions

View File

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

View File

@ -5,11 +5,6 @@ import (
"github.com/c9s/bbgo/pkg/types" "github.com/c9s/bbgo/pkg/types"
) )
type CsvConfig struct {
Market types.MarketType `json:"market"`
Granularity types.MarketDataType `json:"granularity"`
}
type CsvTick struct { type CsvTick struct {
Exchange types.ExchangeName `json:"exchange"` Exchange types.ExchangeName `json:"exchange"`
Market types.MarketType `json:"market"` Market types.MarketType `json:"market"`