mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
do nothing if failed to cancel open orders
This commit is contained in:
parent
bf732ed410
commit
b35cfbeffd
|
@ -75,6 +75,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.Interval, func(k types.KLine) {
|
||||
if err := s.Strategy.OrderExecutor.GracefulCancel(ctx); err != nil {
|
||||
log.WithError(err).Error("unable to cancel open orders...")
|
||||
return
|
||||
}
|
||||
|
||||
account, err := session.UpdateAccount(ctx)
|
||||
|
@ -83,8 +84,14 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
return
|
||||
}
|
||||
|
||||
baseBalance, _ := account.Balance(s.Market.BaseCurrency)
|
||||
quoteBalance, _ := account.Balance(s.Market.QuoteCurrency)
|
||||
baseBalance, ok := account.Balance(s.Market.BaseCurrency)
|
||||
if !ok {
|
||||
log.Errorf("%s balance not found", s.Market.BaseCurrency)
|
||||
}
|
||||
quoteBalance, ok := account.Balance(s.Market.QuoteCurrency)
|
||||
if !ok {
|
||||
log.Errorf("%s balance not found", s.Market.QuoteCurrency)
|
||||
}
|
||||
|
||||
lastAtr := atr.Last(0)
|
||||
log.Infof("atr: %f", lastAtr)
|
||||
|
|
Loading…
Reference in New Issue
Block a user