From a8484046d3339978cb8b112796a5b5df5bc74ced Mon Sep 17 00:00:00 2001 From: austin362667 Date: Mon, 28 Mar 2022 21:12:11 +0800 Subject: [PATCH] bollmaker: add TimeInForce for futures limit order support --- pkg/strategy/bollmaker/strategy.go | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkg/strategy/bollmaker/strategy.go b/pkg/strategy/bollmaker/strategy.go index 4df5f1adf..b9a4f5e5f 100644 --- a/pkg/strategy/bollmaker/strategy.go +++ b/pkg/strategy/bollmaker/strategy.go @@ -319,22 +319,24 @@ func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExec buyQuantity := s.QuantityOrAmount.CalculateQuantity(bidPrice) sellOrder := types.SubmitOrder{ - Symbol: s.Symbol, - Side: types.SideTypeSell, - Type: types.OrderTypeLimitMaker, - Quantity: sellQuantity, - Price: askPrice, - Market: s.Market, - GroupID: s.groupID, + Symbol: s.Symbol, + Side: types.SideTypeSell, + Type: types.OrderTypeLimitMaker, + Quantity: sellQuantity, + Price: askPrice, + Market: s.Market, + GroupID: s.groupID, + TimeInForce: types.TimeInForceGTC, } buyOrder := types.SubmitOrder{ - Symbol: s.Symbol, - Side: types.SideTypeBuy, - Type: types.OrderTypeLimitMaker, - Quantity: buyQuantity, - Price: bidPrice, - Market: s.Market, - GroupID: s.groupID, + Symbol: s.Symbol, + Side: types.SideTypeBuy, + Type: types.OrderTypeLimitMaker, + Quantity: buyQuantity, + Price: bidPrice, + Market: s.Market, + GroupID: s.groupID, + TimeInForce: types.TimeInForceGTC, } var submitOrders []types.SubmitOrder