mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
Merge pull request #933 from COLDTURNIP/fix/bollmaker_dyn_spread_setting_backward_compatibility
bollmaker: fix backward compatibility of dynamic spread settings
This commit is contained in:
commit
1ea8b79654
|
@ -30,7 +30,13 @@ type DynamicSpreadSettings struct {
|
||||||
func (ds *DynamicSpreadSettings) Initialize(symbol string, session *bbgo.ExchangeSession, neutralBoll, defaultBoll *indicator.BOLL) {
|
func (ds *DynamicSpreadSettings) Initialize(symbol string, session *bbgo.ExchangeSession, neutralBoll, defaultBoll *indicator.BOLL) {
|
||||||
switch {
|
switch {
|
||||||
case ds.Enabled != nil && !*ds.Enabled:
|
case ds.Enabled != nil && !*ds.Enabled:
|
||||||
// do nothing
|
// backward compatibility
|
||||||
|
ds.AmpSpreadSettings = &DynamicSpreadAmpSettings{
|
||||||
|
IntervalWindow: ds.IntervalWindow,
|
||||||
|
AskSpreadScale: ds.AskSpreadScale,
|
||||||
|
BidSpreadScale: ds.BidSpreadScale,
|
||||||
|
}
|
||||||
|
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||||
case ds.AmpSpreadSettings != nil:
|
case ds.AmpSpreadSettings != nil:
|
||||||
ds.AmpSpreadSettings.initialize(symbol, session)
|
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||||
case ds.WeightedBollWidthRatioSpreadSettings != nil:
|
case ds.WeightedBollWidthRatioSpreadSettings != nil:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user