From b324149db2efef6a00f0c95454ba96bfede7d61e Mon Sep 17 00:00:00 2001 From: Fredrik <35973823+frin1@users.noreply.github.com> Date: Fri, 29 Jul 2022 09:41:35 +0200 Subject: [PATCH] added SideEffectTypeAutoRepay to supportTakeProfit --- pkg/strategy/pivotshort/strategy.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/strategy/pivotshort/strategy.go b/pkg/strategy/pivotshort/strategy.go index 52bac94ad..d1f28ee47 100644 --- a/pkg/strategy/pivotshort/strategy.go +++ b/pkg/strategy/pivotshort/strategy.go @@ -81,12 +81,13 @@ func (s *SupportTakeProfit) Bind(session *bbgo.ExchangeSession, orderExecutor *b bbgo.Notify("placing %s take profit order at price %f", s.Symbol, buyPrice.Float64()) createdOrders, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ - Symbol: s.Symbol, - Type: types.OrderTypeLimitMaker, - Side: types.SideTypeBuy, - Price: buyPrice, - Quantity: quantity, - Tag: "supportTakeProfit", + Symbol: s.Symbol, + Type: types.OrderTypeLimitMaker, + Side: types.SideTypeBuy, + Price: buyPrice, + Quantity: quantity, + Tag: "supportTakeProfit", + MarginSideEffect: types.SideEffectTypeAutoRepay, }) if err != nil {