bbgo: add more simple slice types to FilterSimpleArgs

This commit is contained in:
c9s 2022-09-19 13:07:56 +08:00
parent e48ae215e5
commit d4398bbbf9
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 2 additions and 2 deletions

View File

@ -361,7 +361,7 @@ func (e *GeneralOrderExecutor) ClosePosition(ctx context.Context, percentage fix
tagStr := strings.Join(tags, ",") tagStr := strings.Join(tags, ",")
submitOrder.Tag = tagStr submitOrder.Tag = tagStr
Notify("closing %s position %s with tags: %v", e.symbol, percentage.Percentage(), tagStr) Notify("Closing %s position %s with tags: %v", e.symbol, percentage.Percentage(), tagStr)
_, err := e.SubmitOrders(ctx, *submitOrder) _, err := e.SubmitOrders(ctx, *submitOrder)
return err return err

View File

@ -12,7 +12,7 @@ import (
func FilterSimpleArgs(args []interface{}) (simpleArgs []interface{}) { func FilterSimpleArgs(args []interface{}) (simpleArgs []interface{}) {
for _, arg := range args { for _, arg := range args {
switch arg.(type) { switch arg.(type) {
case int, int64, int32, uint64, uint32, string, []byte, float64, float32, fixedpoint.Value, time.Time: case int, int64, int32, uint64, uint32, string, []string, []byte, float64, []float64, float32, fixedpoint.Value, time.Time:
simpleArgs = append(simpleArgs, arg) simpleArgs = append(simpleArgs, arg)
default: default:
rt := reflect.TypeOf(arg) rt := reflect.TypeOf(arg)