xmaker: use bbgo.NewPositionFromMarket

This commit is contained in:
c9s 2021-10-17 22:24:51 +08:00
parent 450b7bb61e
commit a3f68d7b72

View File

@ -681,11 +681,7 @@ func (s *Strategy) LoadState() error {
// if position is nil, we need to allocate a new position for calculation
if s.state.Position == nil {
s.state.Position = &bbgo.Position{
Symbol: s.Symbol,
BaseCurrency: s.makerMarket.BaseCurrency,
QuoteCurrency: s.makerMarket.QuoteCurrency,
}
s.state.Position = bbgo.NewPositionFromMarket(s.makerMarket)
}
s.state.ProfitStats.Symbol = s.makerMarket.Symbol