Update freqai-reinforcement-learning docs

closes #8199
This commit is contained in:
Matthias 2023-02-21 19:55:32 +01:00
parent 43962476aa
commit 48ecc7f6dc

View File

@ -176,18 +176,19 @@ As you begin to modify the strategy and the prediction model, you will quickly r
factor = 100 factor = 100
# you can use feature values from dataframe # you can use feature values from dataframe
rsi_now = self.raw_features[f"%-rsi-period-10_shift-1_{self.pair}_" # Assumes the shifted RSI indicator has been generated in the strategy.
f"{self.config['timeframe']}"].iloc[self._current_tick] rsi_now = self.raw_features[f"%-rsi-period-10_shift-1_{self.pair}_"
f"{self.config['timeframe']}"].iloc[self._current_tick]
# reward agent for entering trades # reward agent for entering trades
if (action in (Actions.Long_enter.value, Actions.Short_enter.value) if (action in (Actions.Long_enter.value, Actions.Short_enter.value)
and self._position == Positions.Neutral): and self._position == Positions.Neutral):
if rsi_now < 40: if rsi_now < 40:
factor = 40 / rsi_now factor = 40 / rsi_now
else: else:
factor = 1 factor = 1
return 25 * factor return 25 * factor
# discourage agent from not entering trades # discourage agent from not entering trades
if action == Actions.Neutral.value and self._position == Positions.Neutral: if action == Actions.Neutral.value and self._position == Positions.Neutral: