bbgo_origin/pkg/strategy/grid2/pricemap.go
2022-12-26 01:04:17 +08:00

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
}