From dd7f9c6f8bcfbe52019aee2781817362b7bd3aba Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Fri, 1 Apr 2022 05:45:20 -0600 Subject: [PATCH 1/5] docs for shorting --- docs/leverage.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/leverage.md b/docs/leverage.md index 70f345601..ece717bed 100644 --- a/docs/leverage.md +++ b/docs/leverage.md @@ -13,6 +13,12 @@ Please only use advanced trading modes when you know how freqtrade (and your strategy) works. Also, never risk more than what you can afford to lose. +## Shorting + +Shorting is not possible when trading with [`trading_mode`](#understand-tradingmode) set to `spot`. To short trade, `trading_mode` must be set to `margin`(currently unavailable) or [`futures`](#futures), with [`margin_mode`](#margin-mode) set to `cross`(currently unavailable) or [`isolated`](#isolated-margin-mode) + +For a strategy to short, the strategy class must set the class variable `can_short = True` + ## Understand `trading_mode` The possible values are: `spot` (default), `margin`(*Currently unavailable*) or `futures`. From 3e10849e02027e4efcda7be10cb1a6d59c039904 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Fri, 1 Apr 2022 05:55:00 -0600 Subject: [PATCH 2/5] short docs added link to strategy migration guide --- docs/leverage.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/leverage.md b/docs/leverage.md index ece717bed..be6e61241 100644 --- a/docs/leverage.md +++ b/docs/leverage.md @@ -13,6 +13,9 @@ Please only use advanced trading modes when you know how freqtrade (and your strategy) works. Also, never risk more than what you can afford to lose. + +Please read the [strategy migration guide](https://www.freqtrade.io/en/latest/strategy_migration/#strategy-migration-between-v2-and-v3) to migrate your strategy from a freqtrade v2 strategy, to v3 strategy that can short and trade futures + ## Shorting Shorting is not possible when trading with [`trading_mode`](#understand-tradingmode) set to `spot`. To short trade, `trading_mode` must be set to `margin`(currently unavailable) or [`futures`](#futures), with [`margin_mode`](#margin-mode) set to `cross`(currently unavailable) or [`isolated`](#isolated-margin-mode) From 476c6416ccc9056d824d29951ee4782d6a0e9a3f Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Fri, 1 Apr 2022 05:59:59 -0600 Subject: [PATCH 3/5] docs/strategy-customization enter_short and exit_short --- docs/strategy-customization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index c33ec5fb9..b032cef21 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -205,7 +205,7 @@ Edit the method `populate_entry_trend()` in your strategy file to update your en It's important to always return the dataframe without removing/modifying the columns `"open", "high", "low", "close", "volume"`, otherwise these fields would contain something unexpected. -This method will also define a new column, `"enter_long"`, which needs to contain 1 for entries, and 0 for "no action". `enter_long` column is a mandatory column that must be set even if the strategy is shorting only. +This method will also define a new column, `"enter_long"` (`"enter_short"` for shorts), which needs to contain 1 for entries, and 0 for "no action". `enter_long` column is a mandatory column that must be set even if the strategy is shorting only. Sample from `user_data/strategies/sample_strategy.py`: @@ -268,7 +268,7 @@ Please note that the sell-signal is only used if `use_sell_signal` is set to tru It's important to always return the dataframe without removing/modifying the columns `"open", "high", "low", "close", "volume"`, otherwise these fields would contain something unexpected. -This method will also define a new column, `"exit_long"`, which needs to contain 1 for sells, and 0 for "no action". +This method will also define a new column, `"exit_long"` (`"exit_short"` for shorts), which needs to contain 1 for exits, and 0 for "no action". Sample from `user_data/strategies/sample_strategy.py`: From b4b594c0dd177ac7dfe83ded69ff9c753d5980e8 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Fri, 1 Apr 2022 06:02:32 -0600 Subject: [PATCH 4/5] docs on setting enter_short and exit_short --- docs/leverage.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/leverage.md b/docs/leverage.md index be6e61241..5481c1997 100644 --- a/docs/leverage.md +++ b/docs/leverage.md @@ -22,6 +22,8 @@ Shorting is not possible when trading with [`trading_mode`](#understand-tradingm For a strategy to short, the strategy class must set the class variable `can_short = True` +Please read [strategy customization](https://www.freqtrade.io/en/latest/strategy-customization/#entry-signal-rules) for instructions on how to set signals to enter and exit short trades + ## Understand `trading_mode` The possible values are: `spot` (default), `margin`(*Currently unavailable*) or `futures`. From 2f967f6df9145e3e191daa7596ab75d6f284b243 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 1 Apr 2022 20:01:57 +0200 Subject: [PATCH 5/5] Slightly change wording, fix links --- docs/leverage.md | 5 ++--- docs/strategy-customization.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/leverage.md b/docs/leverage.md index 5481c1997..79d3c9842 100644 --- a/docs/leverage.md +++ b/docs/leverage.md @@ -13,8 +13,7 @@ Please only use advanced trading modes when you know how freqtrade (and your strategy) works. Also, never risk more than what you can afford to lose. - -Please read the [strategy migration guide](https://www.freqtrade.io/en/latest/strategy_migration/#strategy-migration-between-v2-and-v3) to migrate your strategy from a freqtrade v2 strategy, to v3 strategy that can short and trade futures +Please read the [strategy migration guide](strategy_migration.md#strategy-migration-between-v2-and-v3) to migrate your strategy from a freqtrade v2 strategy, to v3 strategy that can short and trade futures. ## Shorting @@ -22,7 +21,7 @@ Shorting is not possible when trading with [`trading_mode`](#understand-tradingm For a strategy to short, the strategy class must set the class variable `can_short = True` -Please read [strategy customization](https://www.freqtrade.io/en/latest/strategy-customization/#entry-signal-rules) for instructions on how to set signals to enter and exit short trades +Please read [strategy customization](strategy-customization.md#entry-signal-rules) for instructions on how to set signals to enter and exit short trades. ## Understand `trading_mode` diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index b032cef21..d413c60ef 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -205,7 +205,7 @@ Edit the method `populate_entry_trend()` in your strategy file to update your en It's important to always return the dataframe without removing/modifying the columns `"open", "high", "low", "close", "volume"`, otherwise these fields would contain something unexpected. -This method will also define a new column, `"enter_long"` (`"enter_short"` for shorts), which needs to contain 1 for entries, and 0 for "no action". `enter_long` column is a mandatory column that must be set even if the strategy is shorting only. +This method will also define a new column, `"enter_long"` (`"enter_short"` for shorts), which needs to contain 1 for entries, and 0 for "no action". `enter_long` is a mandatory column that must be set even if the strategy is shorting only. Sample from `user_data/strategies/sample_strategy.py`: