mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
limit adjustment order quantity
This commit is contained in:
parent
489889d1e6
commit
a9db21adfa
|
@ -41,7 +41,8 @@ type Strategy struct {
|
|||
|
||||
LiquidityUpdateInterval types.Interval `json:"liquidityUpdateInterval"`
|
||||
|
||||
AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
|
||||
AdjustmentUpdateInterval types.Interval `json:"adjustmentUpdateInterval"`
|
||||
MaxAdjustmentOrderQuantity fixedpoint.Value `json:"maxAdjustmentOrderQuantity"`
|
||||
|
||||
NumOfLiquidityLayers int `json:"numOfLiquidityLayers"`
|
||||
LiquiditySlideRule *bbgo.SlideRule `json:"liquidityScale"`
|
||||
|
@ -171,6 +172,11 @@ func (s *Strategy) placeAdjustmentOrders(ctx context.Context) {
|
|||
var adjOrders []types.SubmitOrder
|
||||
|
||||
posSize := s.Position.Base.Abs()
|
||||
|
||||
if !s.MaxAdjustmentOrderQuantity.IsZero() {
|
||||
posSize = fixedpoint.Min(posSize, s.MaxAdjustmentOrderQuantity)
|
||||
}
|
||||
|
||||
tickSize := s.Market.TickSize
|
||||
|
||||
if s.Position.IsShort() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user