mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
chore: remove unused arguments in loss functions
This commit is contained in:
@@ -9,7 +9,6 @@ from datetime import datetime
|
||||
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.data.metrics import calculate_calmar
|
||||
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
||||
|
||||
@@ -24,10 +23,8 @@ class CalmarHyperOptLoss(IHyperOptLoss):
|
||||
@staticmethod
|
||||
def hyperopt_loss_function(
|
||||
results: DataFrame,
|
||||
trade_count: int,
|
||||
min_date: datetime,
|
||||
max_date: datetime,
|
||||
config: Config,
|
||||
starting_balance: float,
|
||||
*args,
|
||||
**kwargs,
|
||||
|
||||
@@ -7,7 +7,6 @@ Hyperoptimization.
|
||||
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.data.metrics import calculate_underwater
|
||||
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
||||
|
||||
@@ -22,7 +21,7 @@ class MaxDrawDownRelativeHyperOptLoss(IHyperOptLoss):
|
||||
|
||||
@staticmethod
|
||||
def hyperopt_loss_function(
|
||||
results: DataFrame, config: Config, starting_balance: float, *args, **kwargs
|
||||
results: DataFrame, starting_balance: float, *args, **kwargs
|
||||
) -> float:
|
||||
"""
|
||||
Objective function.
|
||||
|
||||
@@ -33,7 +33,6 @@ TARGET_TRADE_AMOUNT variable sets the minimum number of trades required to avoid
|
||||
import numpy as np
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.data.metrics import calculate_expectancy, calculate_max_drawdown
|
||||
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
||||
|
||||
@@ -57,7 +56,6 @@ class MultiMetricHyperOptLoss(IHyperOptLoss):
|
||||
def hyperopt_loss_function(
|
||||
results: DataFrame,
|
||||
trade_count: int,
|
||||
config: Config,
|
||||
starting_balance: float,
|
||||
**kwargs,
|
||||
) -> float:
|
||||
|
||||
@@ -10,7 +10,6 @@ individual needs.
|
||||
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.data.metrics import calculate_max_drawdown
|
||||
from freqtrade.optimize.hyperopt import IHyperOptLoss
|
||||
|
||||
@@ -22,7 +21,7 @@ DRAWDOWN_MULT = 0.075
|
||||
class ProfitDrawDownHyperOptLoss(IHyperOptLoss):
|
||||
@staticmethod
|
||||
def hyperopt_loss_function(
|
||||
results: DataFrame, config: Config, starting_balance: float, *args, **kwargs
|
||||
results: DataFrame, starting_balance: float, *args, **kwargs
|
||||
) -> float:
|
||||
total_profit = results["profit_abs"].sum()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user