mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bollmaker: fix backward compatibility of dynamic spread settings
This commit is contained in:
parent
cacc24fb3c
commit
cf16176f5e
|
@ -30,7 +30,13 @@ type DynamicSpreadSettings struct {
|
|||
func (ds *DynamicSpreadSettings) Initialize(symbol string, session *bbgo.ExchangeSession, neutralBoll, defaultBoll *indicator.BOLL) {
|
||||
switch {
|
||||
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:
|
||||
ds.AmpSpreadSettings.initialize(symbol, session)
|
||||
case ds.WeightedBollWidthRatioSpreadSettings != nil:
|
||||
|
|
Loading…
Reference in New Issue
Block a user