mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add trade logger
This commit is contained in:
parent
db8a74238e
commit
6ee831e678
|
@ -347,6 +347,11 @@ func (session *ExchangeSession) Init(ctx context.Context, environ *Environment)
|
|||
}
|
||||
}
|
||||
|
||||
// add trade logger
|
||||
session.UserDataStream.OnTradeUpdate(func(trade types.Trade) {
|
||||
log.Info(trade.String())
|
||||
})
|
||||
|
||||
if viper.GetBool("debug-kline") {
|
||||
session.MarketDataStream.OnKLine(func(kline types.KLine) {
|
||||
log.WithField("marketData", "kline").Infof("kline: %+v", kline)
|
||||
|
|
Loading…
Reference in New Issue
Block a user