Files
.devcontainer
.github
build_helpers
config_examples
docker
docs
freqtrade
commands
configuration
data
edge
enums
exchange
mixins
optimize
space
__init__.py
backtesting.py
bt_progress.py
default_hyperopt_loss.py
edge_cli.py
hyperopt.py
hyperopt_auto.py
hyperopt_interface.py
hyperopt_loss_interface.py
hyperopt_loss_onlyprofit.py
hyperopt_loss_sharpe.py
hyperopt_loss_sharpe_daily.py
hyperopt_loss_sortino.py
hyperopt_loss_sortino_daily.py
hyperopt_tools.py
optimize_reports.py
persistence
plot
plugins
resolvers
rpc
strategy
templates
vendor
__init__.py
__main__.py
constants.py
exceptions.py
freqtradebot.py
loggers.py
main.py
misc.py
wallets.py
worker.py
scripts
tests
user_data
.coveragerc
.dockerignore
.gitattributes
.gitignore
.pylintrc
.readthedocs.yml
.travis.yml
CONTRIBUTING.md
Dockerfile
LICENSE
MANIFEST.in
README.md
docker-compose.yml
environment.yml
freqtrade.service
freqtrade.service.watchdog
mkdocs.yml
pyproject.toml
requirements-dev.txt
requirements-hyperopt.txt
requirements-plot.txt
requirements.txt
setup.cfg
setup.py
setup.sh
stable/freqtrade/optimize/hyperopt_loss_interface.py
2021-07-04 10:15:19 +02:00

30 lines
913 B
Python

"""
IHyperOptLoss interface
This module defines the interface for the loss-function for hyperopt
"""
from abc import ABC, abstractmethod
from datetime import datetime
from typing import Any, Dict
from pandas import DataFrame
class IHyperOptLoss(ABC):
"""
Interface for freqtrade hyperopt Loss functions.
Defines the custom loss function (`hyperopt_loss_function()` which is evaluated every epoch.)
"""
timeframe: str
@staticmethod
@abstractmethod
def hyperopt_loss_function(results: DataFrame, trade_count: int,
min_date: datetime, max_date: datetime,
config: Dict, processed: Dict[str, DataFrame],
backtest_stats: Dict[str, Any],
*args, **kwargs) -> float:
"""
Objective function, returns smaller number for better results
"""