strategy: bollmaker: fix nil pointer

This commit is contained in:
Raphanus Lo 2022-08-25 23:30:07 +08:00
parent f05e1d1da6
commit a2ab9db4eb

View File

@ -429,6 +429,9 @@ func (s *Strategy) hasShortSet() bool {
}
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error {
// initial required information
s.session = session
// StrategyController
s.Status = types.StrategyStatusRunning
@ -460,9 +463,6 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
s.ShadowProtectionRatio = fixedpoint.NewFromFloat(0.01)
}
// initial required information
s.session = session
s.neutralBoll = s.StandardIndicatorSet.BOLL(s.NeutralBollinger.IntervalWindow, s.NeutralBollinger.BandWidth)
s.defaultBoll = s.StandardIndicatorSet.BOLL(s.DefaultBollinger.IntervalWindow, s.DefaultBollinger.BandWidth)