fix emit trade

This commit is contained in:
c9s 2022-03-11 22:07:53 +08:00
parent 5db4e11167
commit 5567ef5676

View File

@ -108,7 +108,7 @@ func (c *TradeCollector) Process() bool {
if c.orderStore.Exists(trade.OrderID) {
c.doneTrades[key] = struct{}{}
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)