mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid: improve error messages
This commit is contained in:
parent
ee68deb114
commit
a94c42d9c2
|
@ -132,12 +132,12 @@ func (s *Strategy) Validate() error {
|
|||
func (s *Strategy) generateGridSellOrders(session *bbgo.ExchangeSession) ([]types.SubmitOrder, error) {
|
||||
currentPriceFloat, ok := session.LastPrice(s.Symbol)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("%s last price not found, skipping", s.Symbol)
|
||||
return nil, fmt.Errorf("can not generate sell orders, %s last price not found", s.Symbol)
|
||||
}
|
||||
|
||||
currentPrice := fixedpoint.NewFromFloat(currentPriceFloat)
|
||||
if currentPrice > s.UpperPrice {
|
||||
return nil, fmt.Errorf("current price %f is higher than upper price %f", currentPrice.Float64(), s.UpperPrice.Float64())
|
||||
return nil, fmt.Errorf("can not generate sell orders, the current price %f is higher than upper price %f", currentPrice.Float64(), s.UpperPrice.Float64())
|
||||
}
|
||||
|
||||
priceRange := s.UpperPrice - s.LowerPrice
|
||||
|
|
Loading…
Reference in New Issue
Block a user