From 929538dd5fa6400ca3ac2a5665b3cdf1de976771 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 25 May 2025 09:44:52 +0200 Subject: [PATCH] docs: refactor exit logic comparisons to includes file this might allow us to reuse this in other parts of the docs. --- docs/includes/strategy-exit-comparisons.md | 17 +++++++++++++++++ docs/strategy-callbacks.md | 17 +---------------- 2 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 docs/includes/strategy-exit-comparisons.md diff --git a/docs/includes/strategy-exit-comparisons.md b/docs/includes/strategy-exit-comparisons.md new file mode 100644 index 000000000..6ee11e5d1 --- /dev/null +++ b/docs/includes/strategy-exit-comparisons.md @@ -0,0 +1,17 @@ +## Exit logic comparisons + +Freqtrade allows your strategy to implement different exit logics. +This section aims to compare each different section, helping you to choose the one that best fits your needs. + +* **`populate_exit_trend()`** - Vectorized exit logic based on the dataframe + * ✅ **Use** to define exit conditions based on indicators or other data that can be calculated in a vectorized manner. + * 🚫 **Don't use** to customize exit conditions for each individual trade, or if trade data is necessary to make an exit decision. +* **`custom_exit()`** - Custom exit signal, called for every open trade every iteration until a trade is closed. + * ✅ **Use** to customize exit conditions for each individual trade, or if trade data is necessary to make an exit decision. +* **`custom_stoploss()`** - Custom stoploss, called for every open trade every iteration until a trade is closed. The value returned here is also used for [stoploss on exchange](stoploss.md#stop-loss-on-exchangefreqtrade). + * ✅ **Use** to customize the stoploss logic to set a dynamic stoploss based on trade data or other conditions. + * 🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()` for that purpose. +* **`custom_roi()`** - Custom ROI, called for every open trade every iteration until a trade is closed. + * ✅ **Use** to customize the minimum ROI threshold to exit a trade dynamically based on profit or other conditions. + * 🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()` for that purpose. + * 🚫 **Don't use** for static roi. Use `minimal_roi` for that purpose instead. diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 12b43f92d..ecc2cbb9b 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -27,23 +27,8 @@ Currently available callbacks: --8<-- "includes/strategy-imports.md" -## Exit logic comparisons +--8<-- "includes/strategy-exit-comparisons.md" -Freqtrade allows your strategy to implement different exit logics. -This section aims to compare each different section, helping you to choose the one that best fits your needs. - -* **`populate_exit_trend()`** - Vectorized exit logic based on the dataframe - * ✅ **Use** to define exit conditions based on indicators or other data that can be calculated in a vectorized manner. - * 🚫 **Don't use** to customize exit conditions for each individual trade, or if trade data is necessary to make an exit decision. -* **`custom_exit()`** - Custom exit signal, called for every open trade every iteration until a trade is closed. - * ✅ **Use** to customize exit conditions for each individual trade, or if trade data is necessary to make an exit decision. -* **`custom_stoploss()`** - Custom stoploss, called for every open trade every iteration until a trade is closed. The value returned here is also used for [stoploss on exchange](stoploss.md#stop-loss-on-exchangefreqtrade). - * ✅ **Use** to customize the stoploss logic to set a dynamic stoploss based on trade data or other conditions. - * 🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()` for that purpose. -* **`custom_roi()`** - Custom ROI, called for every open trade every iteration until a trade is closed. - * ✅ **Use** to customize the minimum ROI threshold to exit a trade dynamically based on profit or other conditions. - * 🚫 **Don't use** to exit a trade immediately based on a specific condition. Use `custom_exit()` for that purpose. - * 🚫 **Don't use** for static roi. Use `minimal_roi` for that purpose instead. ## Bot start