mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
bbgo: add sync config
This commit is contained in:
parent
6286c50f7a
commit
5f7676f0c1
|
@ -192,6 +192,17 @@ func GetNativeBuildTargetConfig() BuildTargetConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SyncConfig struct {
|
||||||
|
// Sessions to sync, if ignored, all defined sessions will sync
|
||||||
|
Sessions []string `json:"sessions,omitempty" yaml:"sessions,omitempty"`
|
||||||
|
|
||||||
|
// Symbols is the list of symbol to sync, if ignored, symbols wlll be discovered by your existing crypto balances
|
||||||
|
Symbols []string `json:"symbols,omitempty" yaml:"symbols,omitempty"`
|
||||||
|
|
||||||
|
// Since is the date where you want to start syncing data
|
||||||
|
Since *time.Time `json:"since,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Build *BuildConfig `json:"build,omitempty" yaml:"build,omitempty"`
|
Build *BuildConfig `json:"build,omitempty" yaml:"build,omitempty"`
|
||||||
|
|
||||||
|
@ -201,6 +212,8 @@ type Config struct {
|
||||||
|
|
||||||
Backtest *Backtest `json:"backtest,omitempty" yaml:"backtest,omitempty"`
|
Backtest *Backtest `json:"backtest,omitempty" yaml:"backtest,omitempty"`
|
||||||
|
|
||||||
|
Sync *SyncConfig `json:"sync,omitempty" yaml:"sync,omitempty"`
|
||||||
|
|
||||||
Notifications *NotificationConfig `json:"notifications,omitempty" yaml:"notifications,omitempty"`
|
Notifications *NotificationConfig `json:"notifications,omitempty" yaml:"notifications,omitempty"`
|
||||||
|
|
||||||
Persistence *PersistenceConfig `json:"persistence,omitempty" yaml:"persistence,omitempty"`
|
Persistence *PersistenceConfig `json:"persistence,omitempty" yaml:"persistence,omitempty"`
|
||||||
|
@ -476,7 +489,7 @@ func loadExchangeStrategies(config *Config, stash Stash) (err error) {
|
||||||
Strategy: st,
|
Strategy: st,
|
||||||
})
|
})
|
||||||
} else if id != "on" && id != "off" {
|
} else if id != "on" && id != "off" {
|
||||||
//Show error when we didn't find the Strategy
|
// Show error when we didn't find the Strategy
|
||||||
return fmt.Errorf("strategy %s in config not found", id)
|
return fmt.Errorf("strategy %s in config not found", id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user