mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bollmaker: fix settings overriding
This commit is contained in:
parent
1ea8b79654
commit
8286356d3b
|
@ -29,7 +29,11 @@ type DynamicSpreadSettings struct {
|
|||
// Initialize dynamic spreads and preload SMAs
|
||||
func (ds *DynamicSpreadSettings) Initialize(symbol string, session *bbgo.ExchangeSession, neutralBoll, defaultBoll *indicator.BOLL) {
|
||||
switch {
|
||||
case ds.Enabled != nil && !*ds.Enabled:
|
||||
case ds.AmpSpreadSettings != nil:
|
||||
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||
case ds.WeightedBollWidthRatioSpreadSettings != nil:
|
||||
ds.WeightedBollWidthRatioSpreadSettings.initialize(neutralBoll, defaultBoll)
|
||||
case ds.Enabled != nil && *ds.Enabled:
|
||||
// backward compatibility
|
||||
ds.AmpSpreadSettings = &DynamicSpreadAmpSettings{
|
||||
IntervalWindow: ds.IntervalWindow,
|
||||
|
@ -37,10 +41,6 @@ func (ds *DynamicSpreadSettings) Initialize(symbol string, session *bbgo.Exchang
|
|||
BidSpreadScale: ds.BidSpreadScale,
|
||||
}
|
||||
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||
case ds.AmpSpreadSettings != nil:
|
||||
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||
case ds.WeightedBollWidthRatioSpreadSettings != nil:
|
||||
ds.WeightedBollWidthRatioSpreadSettings.initialize(neutralBoll, defaultBoll)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user