From: Jérôme Benoit Date: Mon, 10 Mar 2025 10:15:15 +0000 (+0100) Subject: fix(qav3): handle NaN in builtin cmf X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6e11851641ce74a5618bb7817ff547cb64140f67;p=freqai-strategies.git fix(qav3): handle NaN in builtin cmf Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index b348e1f..c2f7ad9 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -130,7 +130,9 @@ class QuickAdapterV3(IStrategy): dataframe["%-er-period"] = pta.er(dataframe["close"], length=period) dataframe["%-rocr-period"] = ta.ROCR(dataframe, timeperiod=period) dataframe["%-trix-period"] = ta.TRIX(dataframe, timeperiod=period) - dataframe["%-cmf-period"] = chaikin_money_flow(dataframe, period=period) + dataframe["%-cmf-period"] = chaikin_money_flow(dataframe, period=period).fillna( + 0.0 + ) dataframe["%-tcp-period"] = top_percent_change(dataframe, period=period) dataframe["%-cti-period"] = pta.cti(dataframe["close"], length=period) dataframe["%-chop-period"] = qtpylib.chopiness(dataframe, period)