bbgo_origin/pkg/strategy/grid2/pricemap.go

17 lines
361 B
Go
Raw Permalink Normal View History

2022-12-25 17:04:17 +00:00
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
}