bbgo: session log error

This commit is contained in:
c9s 2021-01-09 19:40:31 +08:00
parent 9a64acedc9
commit 93d71b5300

View File

@ -96,7 +96,7 @@ func (trader *Trader) DisableLogging() {
// Single exchange strategy is the default behavior.
func (trader *Trader) AttachStrategyOn(session string, strategies ...SingleExchangeStrategy) *Trader {
if _, ok := trader.environment.sessions[session]; !ok {
log.Panicf("Session %s is not defined", session)
log.Panicf("session %s is not defined", session)
}
for _, s := range strategies {
@ -153,7 +153,6 @@ func (trader *Trader) Run(ctx context.Context) error {
session.Stream.OnTradeUpdate(baseOrderExecutor.EmitTradeUpdate)
session.Stream.OnOrderUpdate(baseOrderExecutor.EmitOrderUpdate)
// default to base order executor
var orderExecutor OrderExecutor = baseOrderExecutor
@ -302,4 +301,3 @@ func (trader *Trader) Run(ctx context.Context) error {
func (trader *Trader) ReportPnL() *PnLReporterManager {
return NewPnLReporter(&trader.environment.Notifiability)
}