mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
use lower case in error string and add comment for IOC, FOK
This commit is contained in:
parent
a4aa9c2eda
commit
a0946fbd42
|
@ -168,10 +168,9 @@ func toGlobalOrders(orderDetails []okexapi.OrderDetails) ([]types.Order, error)
|
|||
|
||||
o, err := toGlobalOrder(&orderDetail)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
orders = append(orders, *o)
|
||||
log.WithError(err).Error("order convert error")
|
||||
}
|
||||
orders = append(orders, *o)
|
||||
}
|
||||
|
||||
return orders, nil
|
||||
|
@ -210,6 +209,8 @@ func toLocalOrderType(orderType types.OrderType) (okexapi.OrderType, error) {
|
|||
}
|
||||
|
||||
func toGlobalOrderType(orderType okexapi.OrderType) (types.OrderType, error) {
|
||||
// Okex IOC and FOK only implement limit order
|
||||
// reference: https://www.okx.com/cn/help-center/360025135731
|
||||
switch orderType {
|
||||
case okexapi.OrderTypeMarket:
|
||||
return types.OrderTypeMarket, nil
|
||||
|
|
|
@ -26,7 +26,7 @@ var log = logrus.WithFields(logrus.Fields{
|
|||
"exchange": ID,
|
||||
})
|
||||
|
||||
var ErrSymbolRequired = errors.New("Symbol is required parameter")
|
||||
var ErrSymbolRequired = errors.New("symbol is a required parameter")
|
||||
|
||||
type Exchange struct {
|
||||
key, secret, passphrase string
|
||||
|
|
Loading…
Reference in New Issue
Block a user