Merge pull request #7828 from freqtrade/fix-state-info-rl

bring back market side setting in get_state_info
This commit is contained in:
Matthias 2022-11-30 19:57:28 +01:00 committed by GitHub
commit dac4a35be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,6 +193,10 @@ class BaseReinforcementLearningModel(IFreqaiModel):
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)