From 8b7f4c6222462eed07f9432983e331f23365e558 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 26 Aug 2022 17:21:43 +0800 Subject: [PATCH] bbgo: add ProtectiveStopLoss doc comment --- pkg/bbgo/exit_protective_stop_loss.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/bbgo/exit_protective_stop_loss.go b/pkg/bbgo/exit_protective_stop_loss.go index a1c1a63d4..f4ed4c921 100644 --- a/pkg/bbgo/exit_protective_stop_loss.go +++ b/pkg/bbgo/exit_protective_stop_loss.go @@ -11,6 +11,12 @@ import ( const enableMarketTradeStop = false +// ProtectiveStopLoss provides a way to protect your profit but also keep a room for the price volatility +// Set ActivationRatio to 1% means if the price is away from your average cost by 1%, we will activate the protective stop loss +// and the StopLossRatio is the minimal profit ratio you want to keep for your position. +// If you set StopLossRatio to 0.1% and ActivationRatio to 1%, +// when the price goes away from your average cost by 1% and then goes back to below your (average_cost * (1 - 0.1%)) +// The stop will trigger. type ProtectiveStopLoss struct { Symbol string `json:"symbol"`