mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
xdepthmaker: fix stats fixer
This commit is contained in:
parent
441ebbdbe5
commit
b6ddb49d0a
|
@ -77,8 +77,11 @@ func (f *ProfitFixer) Fix(ctx context.Context, since, until time.Time, stats *ty
|
|||
|
||||
allTrades = types.SortTradesAscending(allTrades)
|
||||
for _, trade := range allTrades {
|
||||
stats.AddTrade(trade)
|
||||
position.AddTrade(trade)
|
||||
profit, netProfit, madeProfit := position.AddTrade(trade)
|
||||
if madeProfit {
|
||||
p := position.NewProfit(trade, profit, netProfit)
|
||||
stats.AddProfit(p)
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("profitFixer done: profitStats and position are updated from %d trades", len(allTrades))
|
||||
|
|
Loading…
Reference in New Issue
Block a user