use RecordPosition

This commit is contained in:
c9s 2022-03-11 17:00:09 +08:00
parent 322f31a56a
commit d67b800e7e

View File

@ -568,7 +568,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
p := s.state.Position.NewProfit(trade, profit, netProfit)
p.Strategy = ID
p.StrategyInstanceID = instanceID
s.Environment.RecordProfit(p)
s.Environment.RecordPosition(s.state.Position, trade, p)
s.state.ProfitStats.AddProfit(p)
s.Notify(&p)