mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +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) {
|
func (s *Strategy) handleBinanceBalanceUpdateEvent(event *binance.BalanceUpdateEvent) {
|
||||||
bbgo.Notify(event)
|
bbgo.Notify(event)
|
||||||
|
|
||||||
if s.MinMarginLevel.IsZero() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
account := s.ExchangeSession.GetAccount()
|
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
|
delta := event.Delta
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user