Skip to content

Commit

Permalink
xgap: put source market loading to the same code area
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Nov 15, 2024
1 parent 6078b2e commit 67a1cd8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/strategy/xgap/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
}
s.sourceSession = sourceSession

tradingSession, ok := sessions[s.TradingExchange]
s.sourceMarket, ok = s.sourceSession.Market(s.SourceSymbol)
if !ok {
return fmt.Errorf("trading session %s is not defined", s.TradingExchange)
return fmt.Errorf("source session market %s is not defined", s.Symbol)
}
s.tradingSession = tradingSession

s.sourceMarket, ok = s.sourceSession.Market(s.SourceSymbol)
tradingSession, ok := sessions[s.TradingExchange]
if !ok {
return fmt.Errorf("source session market %s is not defined", s.Symbol)
return fmt.Errorf("trading session %s is not defined", s.TradingExchange)
}
s.tradingSession = tradingSession

s.tradingMarket, ok = s.tradingSession.Market(s.Symbol)
if !ok {
Expand Down

0 comments on commit 67a1cd8

Please sign in to comment.