From 48ecc7f6dc6a176ca744d99518388dab5d2086f5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 21 Feb 2023 19:55:32 +0100 Subject: [PATCH] Update freqai-reinforcement-learning docs closes #8199 --- docs/freqai-reinforcement-learning.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/freqai-reinforcement-learning.md b/docs/freqai-reinforcement-learning.md index 7358f54c3..3810aec4e 100644 --- a/docs/freqai-reinforcement-learning.md +++ b/docs/freqai-reinforcement-learning.md @@ -176,18 +176,19 @@ As you begin to modify the strategy and the prediction model, you will quickly r factor = 100 - # you can use feature values from dataframe - rsi_now = self.raw_features[f"%-rsi-period-10_shift-1_{self.pair}_" - f"{self.config['timeframe']}"].iloc[self._current_tick] + # you can use feature values from dataframe + # Assumes the shifted RSI indicator has been generated in the strategy. + 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 - if (action in (Actions.Long_enter.value, Actions.Short_enter.value) - and self._position == Positions.Neutral): - if rsi_now < 40: - factor = 40 / rsi_now - else: - factor = 1 - return 25 * factor + # reward agent for entering trades + if (action in (Actions.Long_enter.value, Actions.Short_enter.value) + and self._position == Positions.Neutral): + if rsi_now < 40: + factor = 40 / rsi_now + else: + factor = 1 + return 25 * factor # discourage agent from not entering trades if action == Actions.Neutral.value and self._position == Positions.Neutral: