mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
plus a quantity jitter
This commit is contained in:
parent
42430fde4b
commit
1f6076ae18
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -312,6 +313,9 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
|
|||
}
|
||||
}
|
||||
s.mu.Unlock()
|
||||
} else {
|
||||
// plus a 2% quantity jitter
|
||||
quantity *= 1.0 + math.Max(0.02, rand.Float64())
|
||||
}
|
||||
|
||||
var quoteAmount = price * quantity
|
||||
|
|
Loading…
Reference in New Issue
Block a user