xmaker: fix position notify

This commit is contained in:
c9s 2022-06-13 12:04:35 +08:00
parent 4a6fb63c8b
commit a506a00001
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -693,8 +693,6 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order
if err := s.LoadState(); err != nil {
return err
} else {
s.Notify("xmaker: %s position is restored", s.Symbol, s.Position)
}
if s.Position == nil {
@ -708,6 +706,8 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order
s.Position.Market = s.makerMarket
}
s.Notify("xmaker: %s position is restored", s.Symbol, s.Position)
if s.ProfitStats == nil {
if s.state != nil {
p2 := s.state.ProfitStats