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] = Actions.Neutral
+ dataframe[ACTION_COLUMN] = 0
return dataframe
) -> DataFrame:
enter_long_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == Actions.Long_enter,
+ dataframe.get(ACTION_COLUMN) == 1,
]
dataframe.loc[
reduce(lambda x, y: x & y, enter_long_conditions),
enter_short_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == Actions.Short_enter,
+ dataframe.get(ACTION_COLUMN) == 3,
]
dataframe.loc[
reduce(lambda x, y: x & y, enter_short_conditions),
) -> DataFrame:
exit_long_conditions = [
dataframe.get("do_predict") == 1,
- dataframe.get(ACTION_COLUMN) == Actions.Long_exit,
+ dataframe.get(ACTION_COLUMN) == 2,
]
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) == Actions.Short_exit,
+ dataframe.get(ACTION_COLUMN) == 4,
]
dataframe.loc[
reduce(lambda x, y: x & y, exit_short_conditions), "exit_short"