improve/supertrend: fix typo

This commit is contained in:
Andy Cheng 2023-04-20 18:11:47 +08:00
parent 4b8adf6ed5
commit 1fb6e79090
No known key found for this signature in database
GPG Key ID: 936427CF651A9D28

View File

@ -627,7 +627,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
// Add opposite position amount if any // Add opposite position amount if any
if (side == types.SideTypeSell && s.Position.IsLong()) || (side == types.SideTypeBuy && s.Position.IsShort()) { if (side == types.SideTypeSell && s.Position.IsLong()) || (side == types.SideTypeBuy && s.Position.IsShort()) {
bbgo.Notify("add existing opposite position amount of %s to the amount of open new position order", s.Symbol) bbgo.Notify("add existing opposite position amount of %s to the amount of open new position order", s.Symbol)
amount = amount + s.Position.GetQuantity() amount = amount.Add(s.Position.GetQuantity())
} else if !s.Position.IsDust(closePrice) { } else if !s.Position.IsDust(closePrice) {
bbgo.Notify("existing %s position has the same direction as the signal", s.Symbol) bbgo.Notify("existing %s position has the same direction as the signal", s.Symbol)
return return