mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
liquiditymaker: skip dust quantity
This commit is contained in:
parent
e6ce215979
commit
34200efd54
|
@ -81,12 +81,17 @@ func (g *LiquidityOrderGenerator) Generate(
|
||||||
price := layerPrices[i]
|
price := layerPrices[i]
|
||||||
s := layerScales[i]
|
s := layerScales[i]
|
||||||
|
|
||||||
quantity := factor * s
|
quantity := g.Market.TruncateQuantity(fixedpoint.NewFromFloat(factor * s))
|
||||||
|
|
||||||
|
if g.Market.IsDustQuantity(quantity, price) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
orders = append(orders, types.SubmitOrder{
|
orders = append(orders, types.SubmitOrder{
|
||||||
Symbol: g.Symbol,
|
Symbol: g.Symbol,
|
||||||
Price: price,
|
Price: price,
|
||||||
Type: types.OrderTypeLimitMaker,
|
Type: types.OrderTypeLimitMaker,
|
||||||
Quantity: g.Market.TruncateQuantity(fixedpoint.NewFromFloat(quantity)),
|
Quantity: quantity,
|
||||||
Side: side,
|
Side: side,
|
||||||
Market: g.Market,
|
Market: g.Market,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user