mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
grid: fix order generator checking
This commit is contained in:
parent
a94c42d9c2
commit
13d9f2ba49
|
@ -311,11 +311,12 @@ func (s *Strategy) generateGridBuyOrders(session *bbgo.ExchangeSession) ([]types
|
|||
|
||||
func (s *Strategy) placeGridSellOrders(orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error {
|
||||
orderForms, err := s.generateGridSellOrders(session)
|
||||
|
||||
if len(orderForms) == 0 {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(orderForms) == 0 {
|
||||
return errors.New("none of sell order is generated")
|
||||
}
|
||||
|
||||
|
@ -327,11 +328,12 @@ func (s *Strategy) placeGridSellOrders(orderExecutor bbgo.OrderExecutor, session
|
|||
|
||||
func (s *Strategy) placeGridBuyOrders(orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error {
|
||||
orderForms, err := s.generateGridBuyOrders(session)
|
||||
|
||||
if len(orderForms) == 0 {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(orderForms) == 0 {
|
||||
return errors.New("none of buy order is generated")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user