diff --git a/pkg/core/tradecollector.go b/pkg/core/tradecollector.go index 6069d2c26..ab2b54017 100644 --- a/pkg/core/tradecollector.go +++ b/pkg/core/tradecollector.go @@ -12,8 +12,12 @@ import ( "github.com/c9s/bbgo/pkg/types" ) +type OrderConverter interface { + ConvertOrder(order types.Order) (types.Order, error) +} + type TradeConverter interface { - Convert(trade types.Trade) (types.Trade, error) + ConvertTrade(trade types.Trade) (types.Trade, error) } //go:generate callbackgen -type TradeCollector @@ -65,7 +69,7 @@ func (c *TradeCollector) convertTrade(trade types.Trade) types.Trade { } for _, converter := range c.tradeConverters { - convTrade, err := converter.Convert(trade) + convTrade, err := converter.ConvertTrade(trade) if err != nil { logrus.WithError(err).Errorf("trade %+v converter error, trade: %s", converter, trade.String()) continue