mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
grid2: use Round instead of Trunc
This commit is contained in:
parent
d43acaa17c
commit
4bf0cb6a0c
|
@ -39,7 +39,7 @@ func calculateArithmeticPins(lower, upper, spread, tickSize fixedpoint.Value) []
|
|||
for p := lower; p.Compare(upper) <= 0; p = p.Add(spread) {
|
||||
// tickSize here = 0.01
|
||||
pp := p.Float64() / ts
|
||||
pp = math.Trunc(pp) * ts
|
||||
pp = math.Round(pp) * ts
|
||||
pin := Pin(fixedpoint.NewFromFloat(pp))
|
||||
pins = append(pins, pin)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user