xfunding: improve checkAndRestorePositionRisks

This commit is contained in:
c9s 2023-06-16 18:08:25 +08:00
parent bd347d5aa5
commit f6a3be6ff5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1135,6 +1135,11 @@ func (s *Strategy) checkAndRestorePositionRisks(ctx context.Context) error {
log.Infof("fetched futures position risks: %+v", positionRisks)
if len(positionRisks) == 0 {
s.FuturesPosition.Reset()
return nil
}
for _, positionRisk := range positionRisks {
if positionRisk.Symbol != s.Symbol {
continue