From cf839e36f331983f74bc0fd1dd3bb6be73a61599 Mon Sep 17 00:00:00 2001 From: JoeSchr Date: Thu, 29 Apr 2021 12:49:51 +0200 Subject: [PATCH 1/3] Add to custom_sell() documentation - Flesh out infos about return type - give quick example at beginning to get reader in right mindset what this does and why it's useful --- docs/strategy-advanced.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 49b310303..68b3f201a 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -44,7 +44,11 @@ class AwesomeStrategy(IStrategy): ## Custom sell signal -It is possible to define custom sell signals. This is very useful when we need to customize sell conditions for each individual trade, or if you need the trade profit to take the sell decision. +It is possible to define custom sell signals, indicating that specified position should be sold. This is very useful when we need to customize sell conditions for each individual trade, or if you need the trade profit to take the sell decision. + +For example you could implement a stoploss relative to candle when trade was opened, or a custom 1:2 risk-reward ROI. + +!!! Note Returning a `string` or `True` from this method is equal to setting sell signal on a candle at specified time. This method is not called when sell signal is set. `string` max length is 64 characters. Exceeding this limit will raise `OperationalException`. An example of how we can use different indicators depending on the current profit and also sell trades that were open longer than one day: From f2bd70dfc24e74d56cbc8b42c1610fd8785bc41d Mon Sep 17 00:00:00 2001 From: JoeSchr Date: Thu, 29 Apr 2021 13:07:22 +0200 Subject: [PATCH 2/3] Add sentence about how it differs from custom_stoploss() --- docs/strategy-advanced.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 68b3f201a..8023a18ab 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -46,7 +46,9 @@ class AwesomeStrategy(IStrategy): It is possible to define custom sell signals, indicating that specified position should be sold. This is very useful when we need to customize sell conditions for each individual trade, or if you need the trade profit to take the sell decision. -For example you could implement a stoploss relative to candle when trade was opened, or a custom 1:2 risk-reward ROI. +For example you could implement a 1:2 risk-reward ROI with `custom_sell()`. + +You should abstain from using custom_sell() signals in place of stoplosses though. It is a inferior method to using `custom_stoploss()` in this regard - which also allows you to keep the stoploss on exchange. !!! Note Returning a `string` or `True` from this method is equal to setting sell signal on a candle at specified time. This method is not called when sell signal is set. `string` max length is 64 characters. Exceeding this limit will raise `OperationalException`. From ca0749dfdd6d2b2291bc366f813e070f33a3560e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 1 May 2021 16:58:14 +0200 Subject: [PATCH 3/3] Update strategy-advanced.md --- docs/strategy-advanced.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 8023a18ab..0580b2d39 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -50,7 +50,8 @@ For example you could implement a 1:2 risk-reward ROI with `custom_sell()`. You should abstain from using custom_sell() signals in place of stoplosses though. It is a inferior method to using `custom_stoploss()` in this regard - which also allows you to keep the stoploss on exchange. -!!! Note Returning a `string` or `True` from this method is equal to setting sell signal on a candle at specified time. This method is not called when sell signal is set. `string` max length is 64 characters. Exceeding this limit will raise `OperationalException`. +!!! Note + Returning a `string` or `True` from this method is equal to setting sell signal on a candle at specified time. This method is not called when sell signal is set already, or if sell signals are disabled (`use_sell_signal=False`). `string` max length is 64 characters. Exceeding this limit will cause the message to be truncated to 64 characters. An example of how we can use different indicators depending on the current profit and also sell trades that were open longer than one day: