From: Jérôme Benoit Date: Thu, 30 Jan 2025 21:28:22 +0000 (+0100) Subject: feat: add psar and keltner channel width as features X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=dc593521f7db1782798c1f59d94899767cb87dd3;p=freqai-strategies.git feat: add psar and keltner channel width as features Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index ee4df1b..a8a0370 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -132,6 +132,19 @@ class QuickAdapterV3(IStrategy): dataframe["%-raw_volume"] = dataframe["volume"] dataframe["%-obv"] = ta.OBV(dataframe) # Added + psar = ta.SAR( + dataframe["high"], dataframe["low"], acceleration=0.02, maximum=0.2 + ) + dataframe["%-diff_to_psar"] = dataframe["close"] - psar + kc = qtpylib.keltner_channel( + qtpylib.typical_price(dataframe), window=14, atrs=2 + ) + dataframe["kc_lowerband"] = kc["lower"] + dataframe["kc_middleband"] = kc["mid"] + dataframe["kc_upperband"] = kc["upper"] + dataframe["%-kc_width"] = ( + dataframe["kc_upperband"] - dataframe["kc_lowerband"] + ) / dataframe["kc_middleband"] bollinger = qtpylib.bollinger_bands( qtpylib.typical_price(dataframe), window=14, stds=2.2 )