mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
grid2: pull out CalculatePins
This commit is contained in:
parent
1fa5186002
commit
32b6299b93
|
@ -60,11 +60,15 @@ func NewGrid(lower, upper, size, tickSize fixedpoint.Value) *Grid {
|
||||||
Spread: spread,
|
Spread: spread,
|
||||||
}
|
}
|
||||||
|
|
||||||
var pins = calculateArithmeticPins(lower, upper, spread, tickSize)
|
grid.CalculatePins()
|
||||||
grid.addPins(pins)
|
|
||||||
return grid
|
return grid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *Grid) CalculatePins() {
|
||||||
|
var pins = calculateArithmeticPins(g.LowerPrice, g.UpperPrice, g.Spread, g.TickSize)
|
||||||
|
g.addPins(pins)
|
||||||
|
}
|
||||||
|
|
||||||
func (g *Grid) Height() fixedpoint.Value {
|
func (g *Grid) Height() fixedpoint.Value {
|
||||||
return g.UpperPrice.Sub(g.LowerPrice)
|
return g.UpperPrice.Sub(g.LowerPrice)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user