Update hyperopt-loss to use resolver
This commit is contained in:
25
freqtrade/optimize/hyperopt_loss_interface.py
Normal file
25
freqtrade/optimize/hyperopt_loss_interface.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
IHyperOptLoss interface
|
||||
This module defines the interface for the loss-function for hyperopts
|
||||
"""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import datetime
|
||||
|
||||
from pandas import DataFrame
|
||||
|
||||
|
||||
class IHyperOptLoss(ABC):
|
||||
"""
|
||||
Interface for freqtrade hyperopts Loss functions.
|
||||
Defines the custom loss function (`hyperopt_loss_function()` which is evaluated every epoch.)
|
||||
"""
|
||||
ticker_interval: str
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def hyperopt_loss_function(results: DataFrame, trade_count: int,
|
||||
min_date: datetime, max_date: datetime, *args, **kwargs) -> float:
|
||||
"""
|
||||
Objective function, returns smaller number for better results
|
||||
"""
|
||||
Reference in New Issue
Block a user