mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
xfunding: improve checkAndRestorePositionRisks
This commit is contained in:
parent
bd347d5aa5
commit
f6a3be6ff5
|
@ -1135,6 +1135,11 @@ func (s *Strategy) checkAndRestorePositionRisks(ctx context.Context) error {
|
||||||
|
|
||||||
log.Infof("fetched futures position risks: %+v", positionRisks)
|
log.Infof("fetched futures position risks: %+v", positionRisks)
|
||||||
|
|
||||||
|
if len(positionRisks) == 0 {
|
||||||
|
s.FuturesPosition.Reset()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
for _, positionRisk := range positionRisks {
|
for _, positionRisk := range positionRisks {
|
||||||
if positionRisk.Symbol != s.Symbol {
|
if positionRisk.Symbol != s.Symbol {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user