Update a few missed ruff format updates

This commit is contained in:
Matthias 2024-05-12 18:02:42 +02:00
parent 9d6e4ae67d
commit b97ff77d65
7 changed files with 15 additions and 12 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3
from freqtrade_client import __version__ as client_version
from freqtrade import __version__ as ft_version
from freqtrade_client import __version__ as client_version
def main():

View File

@ -197,9 +197,9 @@ class BaseReinforcementLearningModel(IFreqaiModel):
"df_raw": self.df_raw,
}
if self.data_provider:
env_info["fee"] = self.data_provider._exchange.get_fee(
env_info["fee"] = self.data_provider._exchange.get_fee( # type: ignore
symbol=self.data_provider.current_whitelist()[0]
) # type: ignore
)
return env_info

View File

@ -42,8 +42,8 @@ class LightGBMRegressorMultiTarget(BaseRegressionModel):
eval_weights = [data_dictionary["test_weights"]]
eval_sets = [(None, None)] * data_dictionary["test_labels"].shape[1] # type: ignore
for i in range(data_dictionary["test_labels"].shape[1]):
eval_sets[i] = [
( # type: ignore
eval_sets[i] = [ # type: ignore
(
data_dictionary["test_features"],
data_dictionary["test_labels"].iloc[:, i],
)

View File

@ -41,8 +41,8 @@ class XGBoostRegressorMultiTarget(BaseRegressionModel):
if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) != 0:
eval_weights = [data_dictionary["test_weights"]]
for i in range(data_dictionary["test_labels"].shape[1]):
eval_sets[i] = [
( # type: ignore
eval_sets[i] = [ # type: ignore
(
data_dictionary["test_features"],
data_dictionary["test_labels"].iloc[:, i],
)

View File

@ -873,9 +873,9 @@ class Backtesting:
enter = row[SHORT_IDX] if trade.is_short else row[LONG_IDX]
exit_sig = row[ESHORT_IDX] if trade.is_short else row[ELONG_IDX]
exits = self.strategy.should_exit(
trade,
trade, # type: ignore
row[OPEN_IDX],
row[DATE_IDX].to_pydatetime(), # type: ignore
row[DATE_IDX].to_pydatetime(),
enter=enter,
exit_=exit_sig,
low=row[LOW_IDX],

View File

@ -334,7 +334,10 @@ def text_table_add_metrics(strat_results: Dict) -> str:
("Avg. Duration Loser", f"{strat_results['loser_holding_avg']}"),
(
"Max Consecutive Wins / Loss",
f"{strat_results['max_consecutive_wins']} / {strat_results['max_consecutive_losses']}"
(
f"{strat_results['max_consecutive_wins']} / "
f"{strat_results['max_consecutive_losses']}"
)
if "max_consecutive_losses" in strat_results
else "N/A",
),

View File

@ -765,7 +765,8 @@ class Telegram(RPCHandler):
if r.get("realized_profit"):
lines.extend(
[
"*Realized Profit:* `{realized_profit_ratio:.2%} ({realized_profit_r})`",
"*Realized Profit:* `{realized_profit_ratio:.2%} "
"({realized_profit_r})`",
"*Total Profit:* `{total_profit_ratio:.2%} ({total_profit_abs_r})`",
]
)