bollmaker: call RecordProfit

This commit is contained in:
c9s 2022-03-06 15:39:20 +08:00
parent 8fa0e6702c
commit 25f3aeef58
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -76,7 +76,7 @@ func (p *Position) NewProfit(trade Trade, profit, netProfit fixedpoint.Value) Pr
// FeeInUSD: 0, // FeeInUSD: 0,
Fee: trade.Fee, Fee: trade.Fee,
FeeCurrency: trade.FeeCurrency, FeeCurrency: trade.FeeCurrency,
Exchange: trade.Exchange, Exchange: trade.Exchange,
IsMargin: trade.IsMargin, IsMargin: trade.IsMargin,
IsFutures: trade.IsFutures, IsFutures: trade.IsFutures,