[
make_env(
self.MyRLEnv,
- "train_env",
+ f"train_env{i}",
i,
seed,
train_df,
[
make_env(
self.MyRLEnv,
- "eval_env",
+ f"eval_env{i}",
i,
seed,
test_df,
enter_short_prices = history.loc[history_type == "short_enter", "price"]
exit_long_prices = history.loc[history_type == "long_exit", "price"]
exit_short_prices = history.loc[history_type == "short_exit", "price"]
- take_profit_prices = history.loc[history_type == "take_profit"]
+ take_profit_prices = history.loc[history_type == "take_profit", "price"]
stop_loss_prices = history.loc[history_type == "stop_loss", "price"]
timeout_prices = history.loc[history_type == "timeout", "price"]
from typing import Any
# import talib.abstract as ta
+from freqtrade.freqai.RL.Base5ActionRLEnv import Actions
from freqtrade.strategy import IStrategy
from pandas import DataFrame
def set_freqai_targets(
self, dataframe: DataFrame, metadata: dict[str, Any], **kwargs
) -> DataFrame:
- dataframe[ACTION_COLUMN] = 0
+ dataframe[ACTION_COLUMN] = Actions.Neutral
return dataframe
) -> DataFrame:
enter_long_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == 1,
+ dataframe.get(ACTION_COLUMN) == Actions.Long_enter,
]
dataframe.loc[
reduce(lambda x, y: x & y, enter_long_conditions),
enter_short_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == 3,
+ dataframe.get(ACTION_COLUMN) == Actions.Short_enter,
]
dataframe.loc[
reduce(lambda x, y: x & y, enter_short_conditions),
) -> DataFrame:
exit_long_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == 2,
+ dataframe.get(ACTION_COLUMN) == Actions.Long_exit,
]
dataframe.loc[reduce(lambda x, y: x & y, exit_long_conditions), "exit_long"] = 1
exit_short_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == 4,
+ dataframe.get(ACTION_COLUMN) == Actions.Short_exit,
]
dataframe.loc[
reduce(lambda x, y: x & y, exit_short_conditions), "exit_short"