mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-27 01:05:15 +00:00
17 lines
361 B
Go
17 lines
361 B
Go
package grid2
|
|
|
|
import "github.com/c9s/bbgo/pkg/fixedpoint"
|
|
|
|
type PriceMap map[string]fixedpoint.Value
|
|
|
|
func buildGridPriceMap(grid *Grid) PriceMap {
|
|
// Add all open orders to the local order book
|
|
gridPriceMap := make(PriceMap)
|
|
for _, pin := range grid.Pins {
|
|
price := fixedpoint.Value(pin)
|
|
gridPriceMap[price.String()] = price
|
|
}
|
|
|
|
return gridPriceMap
|
|
}
|