mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
pivotshort: improve balance check for margin
This commit is contained in:
parent
09ba2d31c3
commit
c792da2164
|
@ -294,6 +294,10 @@ func (s *Strategy) placeOrder(ctx context.Context, price fixedpoint.Value, quant
|
|||
}
|
||||
|
||||
func (s *Strategy) useQuantityOrBaseBalance(quantity fixedpoint.Value) fixedpoint.Value {
|
||||
if s.session.Margin || s.session.IsolatedMargin || s.session.Futures || s.session.IsolatedFutures {
|
||||
return quantity
|
||||
}
|
||||
|
||||
balance, hasBalance := s.session.Account.Balance(s.Market.BaseCurrency)
|
||||
|
||||
if hasBalance {
|
||||
|
|
Loading…
Reference in New Issue
Block a user