fix FilterSimpleArgs

This commit is contained in:
c9s 2022-07-12 17:55:15 +08:00
parent b521a7cf70
commit 6ce9f6a2b7
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,7 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
} }
if lastLow.Compare(s.lastLow) != 0 { if lastLow.Compare(s.lastLow) != 0 {
bbgo.Notify("%s new pivot low detected: %f %s", s.Symbol, s.pivot.LastLow(), kline.EndTime.Time()) bbgo.Notify("%s new pivot low detected: %f %s", s.Symbol, s.pivot.LastLow(), kline.EndTime.Time().String())
} }
s.lastLow = lastLow s.lastLow = lastLow

View File

@ -2,6 +2,7 @@ package util
import ( import (
"reflect" "reflect"
"time"
"github.com/c9s/bbgo/pkg/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
) )
@ -11,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: case int, int64, int32, uint64, uint32, string, []byte, float64, float32, fixedpoint.Value, time.Time:
simpleArgs = append(simpleArgs, arg) simpleArgs = append(simpleArgs, arg)
default: default:
rt := reflect.TypeOf(arg) rt := reflect.TypeOf(arg)