mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add maxPrice, minPrice and tickSize config
This commit is contained in:
parent
64c2170cd5
commit
2b41f76082
|
@ -60,6 +60,11 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) {
|
|||
market.MinNotional = util.MustParseFloat(f.MinNotional)
|
||||
}
|
||||
|
||||
// The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol.
|
||||
// There are 3 parts:
|
||||
// minQty defines the minimum quantity/icebergQty allowed.
|
||||
// maxQty defines the maximum quantity/icebergQty allowed.
|
||||
// stepSize defines the intervals that a quantity/icebergQty can be increased/decreased by.
|
||||
if f := symbol.LotSizeFilter() ; f != nil {
|
||||
market.MinLot = util.MustParseFloat(f.MinQuantity)
|
||||
market.MinQuantity = util.MustParseFloat(f.MinQuantity)
|
||||
|
@ -68,9 +73,9 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) {
|
|||
}
|
||||
|
||||
if f := symbol.PriceFilter() ; f != nil {
|
||||
_ = f.MaxPrice
|
||||
_ = f.MinPrice
|
||||
_ = f.TickSize
|
||||
market.MaxPrice = util.MustParseFloat(f.MaxPrice)
|
||||
market.MinPrice = util.MustParseFloat(f.MinPrice)
|
||||
market.TickSize = util.MustParseFloat(f.TickSize)
|
||||
}
|
||||
|
||||
markets[symbol.Symbol] = market
|
||||
|
|
|
@ -20,6 +20,10 @@ type Market struct {
|
|||
MinAmount float64
|
||||
MinNotional float64
|
||||
MinLot float64
|
||||
|
||||
MinPrice float64
|
||||
MaxPrice float64
|
||||
TickSize float64
|
||||
}
|
||||
|
||||
func (m Market) FormatPrice(val float64) string {
|
||||
|
|
Loading…
Reference in New Issue
Block a user