mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
autoborrow: always repay first when it deposits
This commit is contained in:
parent
fe5a6f4c36
commit
5a30bedc77
|
@ -368,15 +368,7 @@ func (s *Strategy) handleBalanceUpdate(balances types.BalanceMap) {
|
|||
func (s *Strategy) handleBinanceBalanceUpdateEvent(event *binance.BalanceUpdateEvent) {
|
||||
bbgo.Notify(event)
|
||||
|
||||
if s.MinMarginLevel.IsZero() {
|
||||
return
|
||||
}
|
||||
|
||||
account := s.ExchangeSession.GetAccount()
|
||||
if account.MarginLevel.Compare(s.MinMarginLevel) > 0 {
|
||||
bbgo.Notify("account margin level %f is greater than minimal margin level %f, skip", account.MarginLevel.Float64(), s.MinMarginLevel.Float64())
|
||||
return
|
||||
}
|
||||
|
||||
delta := event.Delta
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user