pivotshort: add total quantity to the notification

This commit is contained in:
c9s 2022-07-27 12:51:04 +08:00
parent b067c02cf0
commit 9b35c789ee
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -109,10 +109,8 @@ func (s *ResistanceShort) updateResistanceOrders(closePrice fixedpoint.Value) {
ctx := context.Background()
resistanceUpdated := s.updateCurrentResistancePrice(closePrice)
if resistanceUpdated {
bbgo.Notify("Found next %s resistance price at %f, updating resistance orders...", s.Symbol, s.currentResistancePrice.Float64())
s.placeResistanceOrders(ctx, s.currentResistancePrice)
} else if s.activeOrders.NumOfOrders() == 0 && !s.currentResistancePrice.IsZero() {
bbgo.Notify("There is no %s resistance open order, re-placing resistance orders at %f...", s.Symbol, s.currentResistancePrice.Float64())
s.placeResistanceOrders(ctx, s.currentResistancePrice)
}
}
@ -127,6 +125,8 @@ func (s *ResistanceShort) placeResistanceOrders(ctx context.Context, resistanceP
return
}
bbgo.Notify("Next %s resistance price at %f, updating resistance orders with total quantity...", s.Symbol, s.currentResistancePrice.Float64(), totalQuantity.Float64())
numLayers := s.NumLayers
if numLayers == 0 {
numLayers = 1