From e9d9ebf1565dd39a0f391959d3be000e321954c9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 19 Oct 2024 13:05:59 +0200 Subject: [PATCH] docs: Update documentation for MultiMetricHyperOptLoss --- docs/hyperopt.md | 7 ++++--- .../hyperopt_loss/hyperopt_loss_multi_metric.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 43085029c..6788f681a 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -588,14 +588,15 @@ Currently, the following loss functions are builtin: * `ShortTradeDurHyperOptLoss` - (default legacy Freqtrade hyperoptimization loss function) - Mostly for short trade duration and avoiding losses. * `OnlyProfitHyperOptLoss` - takes only amount of profit into consideration. -* `SharpeHyperOptLoss` - optimizes Sharpe Ratio calculated on trade returns relative to standard deviation. -* `SharpeHyperOptLossDaily` - optimizes Sharpe Ratio calculated on **daily** trade returns relative to standard deviation. -* `SortinoHyperOptLoss` - optimizes Sortino Ratio calculated on trade returns relative to **downside** standard deviation. +* `SharpeHyperOptLoss` - Optimizes Sharpe Ratio calculated on trade returns relative to standard deviation. +* `SharpeHyperOptLossDaily` - Optimizes Sharpe Ratio calculated on **daily** trade returns relative to standard deviation. +* `SortinoHyperOptLoss` - Optimizes Sortino Ratio calculated on trade returns relative to **downside** standard deviation. * `SortinoHyperOptLossDaily` - optimizes Sortino Ratio calculated on **daily** trade returns relative to **downside** standard deviation. * `MaxDrawDownHyperOptLoss` - Optimizes Maximum absolute drawdown. * `MaxDrawDownRelativeHyperOptLoss` - Optimizes both maximum absolute drawdown while also adjusting for maximum relative drawdown. * `CalmarHyperOptLoss` - Optimizes Calmar Ratio calculated on trade returns relative to max drawdown. * `ProfitDrawDownHyperOptLoss` - Optimizes by max Profit & min Drawdown objective. `DRAWDOWN_MULT` variable within the hyperoptloss file can be adjusted to be stricter or more flexible on drawdown purposes. +* `MultiMetricHyperOptLoss` - Optimizes by several key metrics to achieve balanced performance. The primary focus is on maximizing Profit and minimizing Drawdown, while also considering additional metrics such as Profit Factor, Expectancy Ratio and Winrate. Moreover, it applies a penalty for epochs with a low number of trades, encouraging strategies with adequate trade frequency. Creation of a custom loss function is covered in the [Advanced Hyperopt](advanced-hyperopt.md) part of the documentation. diff --git a/freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py index 3a11a938d..62f7e90d5 100644 --- a/freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py +++ b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py @@ -15,6 +15,19 @@ Possible to change: - `EXPECTANCY_CONST` to adjust expectancy ratio impact. - `PF_CONST` to adjust profit factor impact. - `WINRATE_CONST` to adjust winrate impact. + + +DRAWDOWN_MULT variable within the hyperoptloss file can be adjusted to be stricter or more + flexible on drawdown purposes. Smaller numbers penalize drawdowns more severely. +PF_CONST variable adjusts the impact of the Profit Factor on the optimization. +EXPECTANCY_CONST variable controls the influence of the Expectancy Ratio. +WINRATE_CONST variable can be adjusted to increase or decrease impact of winrate. + +PF_CONST, EXPECTANCY_CONST, WINRATE_CONST all operate in a similar manner: + a higher value means that the metric has a lesser impact on the objective, + while a lower value means that it has a greater impact. +TARGET_TRADE_AMOUNT variable sets the minimum number of trades required to avoid penalties. + If the trade amount falls below this threshold, the penalty is applied. """ from datetime import datetime