mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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,
|
||||
}
|
||||
|
||||
var pins = calculateArithmeticPins(lower, upper, spread, tickSize)
|
||||
grid.addPins(pins)
|
||||
grid.CalculatePins()
|
||||
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 {
|
||||
return g.UpperPrice.Sub(g.LowerPrice)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user