fix: percent_change from candle must provide percentage, not ratio

closes #10937
This commit is contained in:
Matthias
2024-11-16 08:50:41 +01:00
parent cbc4bb5420
commit c61a71a36e

View File

@@ -293,7 +293,9 @@ class PercentChangePairList(IPairList):
current_close = pair_candles["close"].iloc[-1]
previous_close = pair_candles["close"].shift(self._lookback_period).iloc[-1]
pct_change = (
((current_close - previous_close) / previous_close) if previous_close > 0 else 0
((current_close - previous_close) / previous_close) * 100
if previous_close > 0
else 0
)
# replace change with a range change sum calculated above