mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
xmaker: bind price solver with market data stream
This commit is contained in:
parent
e8c063c09b
commit
be353c533b
|
@ -1398,7 +1398,6 @@ func (s *Strategy) CrossRun(
|
|||
|
||||
// initialize the price resolver
|
||||
sourceMarkets := s.sourceSession.Markets()
|
||||
s.priceSolver = pricesolver.NewSimplePriceResolver(sourceMarkets)
|
||||
|
||||
makerSession, ok := sessions[s.MakerExchange]
|
||||
if !ok {
|
||||
|
@ -1475,6 +1474,9 @@ func (s *Strategy) CrossRun(
|
|||
})
|
||||
}
|
||||
|
||||
s.priceSolver = pricesolver.NewSimplePriceResolver(sourceMarkets)
|
||||
s.priceSolver.BindStream(s.sourceSession.MarketDataStream)
|
||||
|
||||
s.sourceSession.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, types.Interval1m, func(k types.KLine) {
|
||||
s.priceSolver.Update(k.Symbol, k.Close)
|
||||
feeToken := s.sourceSession.Exchange.PlatformFeeCurrency()
|
||||
|
|
Loading…
Reference in New Issue
Block a user