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