bbgo: fix emit trade profit

This commit is contained in:
c9s 2022-03-15 14:29:15 +08:00
parent 0d0e0039e5
commit fdf64fd891

View File

@ -141,7 +141,7 @@ func (c *TradeCollector) processTrade(trade types.Trade) bool {
}
if profit, netProfit, madeProfit := c.position.AddTrade(trade); madeProfit {
c.EmitTrade(trade, fixedpoint.Zero, fixedpoint.Zero)
c.EmitTrade(trade, profit, netProfit)
c.EmitProfit(trade, profit, netProfit)
} else {
c.EmitTrade(trade, fixedpoint.Zero, fixedpoint.Zero)