mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
xfunding: add PositionReady case
This commit is contained in:
parent
256e09a863
commit
b77618f9d8
|
@ -404,10 +404,12 @@ func (s *Strategy) CrossRun(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
switch s.State.PositionState {
|
switch s.State.PositionState {
|
||||||
|
case PositionReady:
|
||||||
|
|
||||||
case PositionOpening:
|
case PositionOpening:
|
||||||
// transfer all base assets from the spot account into the spot account
|
// transfer all base assets from the spot account into the spot account
|
||||||
if err := s.transferIn(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil {
|
if err := s.transferIn(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil {
|
||||||
|
@ -419,6 +421,7 @@ func (s *Strategy) CrossRun(
|
||||||
if err := s.transferOut(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil {
|
if err := s.transferOut(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil {
|
||||||
log.WithError(err).Errorf("futures asset transfer out error")
|
log.WithError(err).Errorf("futures asset transfer out error")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s.spotOrderExecutor = s.allocateOrderExecutor(ctx, s.spotSession, instanceID, s.SpotPosition)
|
s.spotOrderExecutor = s.allocateOrderExecutor(ctx, s.spotSession, instanceID, s.SpotPosition)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user