mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1161 from c9s/fix/grid2/profit-fixer-init-order-id
FIX: [grid2] add initialOrderID check and try to fix profitStats.Since
This commit is contained in:
commit
a3f7e29321
|
@ -51,10 +51,15 @@ func (f *ProfitFixer) Fix(ctx context.Context, since, until time.Time, initialOr
|
|||
continue
|
||||
}
|
||||
|
||||
if profitStats.InitialOrderID == 0 {
|
||||
if profitStats.InitialOrderID == 0 || order.OrderID < profitStats.InitialOrderID {
|
||||
profitStats.InitialOrderID = order.OrderID
|
||||
}
|
||||
|
||||
if profitStats.Since == nil || profitStats.Since.IsZero() || order.CreationTime.Time().Before(*profitStats.Since) {
|
||||
ct := order.CreationTime.Time()
|
||||
profitStats.Since = &ct
|
||||
}
|
||||
|
||||
if order.Status != types.OrderStatusFilled {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user