Skip to content

Commit

Permalink
Merge pull request freqtrade#7828 from freqtrade/fix-state-info-rl
Browse files Browse the repository at this point in the history
bring back market side setting in get_state_info
  • Loading branch information
xmatthias authored Nov 30, 2022
2 parents 2bcd8e4 + e7f72d5 commit dac4a35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions freqtrade/freqai/RL/BaseReinforcementLearningModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def get_state_info(self, pair: str) -> Tuple[float, float, int]:
now = datetime.now(timezone.utc).timestamp()
trade_duration = int((now - trade.open_date_utc.timestamp()) / self.base_tf_seconds)
current_profit = trade.calc_profit_ratio(current_rate)
if trade.is_short:
market_side = 0
else:
market_side = 1

return market_side, current_profit, int(trade_duration)

Expand Down

0 comments on commit dac4a35

Please sign in to comment.