From 6c22c3799ebd49286d7952c7a89e5256aaec498a Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 11 Sep 2022 02:01:48 +0800 Subject: [PATCH] bbgo: Add ClosePosition doc comment --- pkg/bbgo/order_executor_general.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/bbgo/order_executor_general.go b/pkg/bbgo/order_executor_general.go index fb92c8229..2b38d35e8 100644 --- a/pkg/bbgo/order_executor_general.go +++ b/pkg/bbgo/order_executor_general.go @@ -248,6 +248,9 @@ func (e *GeneralOrderExecutor) GracefulCancel(ctx context.Context) error { return e.GracefulCancelActiveOrderBook(ctx, e.activeMakerOrders) } +// ClosePosition closes the current position by a percentage. +// percentage 0.1 means close 10% position +// tag is the order tag you want to attach, you may pass multiple tags, the tags will be combined into one tag string by commas. func (e *GeneralOrderExecutor) ClosePosition(ctx context.Context, percentage fixedpoint.Value, tags ...string) error { submitOrder := e.position.NewMarketCloseOrder(percentage) if submitOrder == nil {