From: Jérôme Benoit Date: Sat, 5 Apr 2025 10:36:36 +0000 (+0200) Subject: perf(qav3): fine tune extrema labeling X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f0f2429d8852d4af674d4766786708b0e0dc9119;p=freqai-strategies.git perf(qav3): fine tune extrema labeling Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/docs/labeling_window.txt b/quickadapter/docs/labeling_window.txt index d65c8aa..b43d884 100644 --- a/quickadapter/docs/labeling_window.txt +++ b/quickadapter/docs/labeling_window.txt @@ -15,6 +15,7 @@ Labeling window: Price movement expectation over the labeling window: ---------------------------------------------------- +current natr = (atr / current close) * 100 trade duration candles = (current candle date - trade candle date) // timeframe (in the same time unit) trade candle @@ -25,8 +26,8 @@ trade duration candles = (current candle date - trade candle date) // timeframe [ current natr label window ] trade duration candles = 0 -expected trade price movement in the future label window candles from trade opening = trade natr * trade rate -expected price movement in the future label window candles = current natr * current rate +expected trade price movement in the future label window candles from trade opening = trade natr * 0.01 * trade rate +expected price movement in the future label window candles = current natr * 0.01 * current rate trade candle current candle | | @@ -35,10 +36,10 @@ expected price movement in the future label window candles = current natr * curr ] trade duration candles > 0 -expected trade price movement in the future label window candles from trade opening = trade natr * trade rate -expected trade price movement in the future trade duration candles window from trade opening = trade natr * trade rate * trade duration candles / label window -expected price movement in the future label window candles = current natr * current rate -expected price movement in the future trade duration candles window = current natr * current rate * trade duration candles / label window +expected trade price movement in the future label window candles from trade opening = trade natr * 0.01 * trade rate +expected trade price movement in the future trade duration candles window from trade opening = trade natr * 0.01 * trade rate * trade duration candles / label window +expected price movement in the future label window candles = current natr * 0.01 * current rate +expected price movement in the future trade duration candles window = current natr * 0.01 * current rate * trade duration candles / label window trade 1 candle trade 2 candle current candle | | | @@ -47,5 +48,5 @@ expected price movement in the future trade duration candles window = current na [ trade 2 natr label window ] ] -expected trade price movement in the future trade duration candles window from trade opening approximation = trade natr * trade rate * trade duration candles / label window -expected price movement in the future trade duration candles window approximation = current natr * current rate * trade duration candles / label window +expected trade price movement in the future trade duration candles window from trade opening approximation = trade natr * 0.01 * trade rate * trade duration candles / label window +expected price movement in the future trade duration candles window approximation = current natr * 0.01 * current rate * trade duration candles / label window diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index ea9f6dd..3796294 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -44,7 +44,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel): https://github.com/sponsors/robcaulk """ - version = "3.6.5" + version = "3.6.6" @cached_property def __optuna_config(self) -> dict: @@ -200,7 +200,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel): return model def get_label_period_candles(self, pair: str) -> int: - label_period_candles = self.__optuna_period_params.get(pair, {}).get( + label_period_candles = self.__optuna_period_params.get(pair).get( "label_period_candles" ) if label_period_candles: @@ -417,9 +417,9 @@ class QuickAdapterRegressorV3(BaseRegressionModel): self, pair: str, namespace: str, study: optuna.study.Study ) -> None: if namespace == "hp": - best_params = self.__optuna_hp_params.get(pair, {}) + best_params = self.__optuna_hp_params.get(pair) elif namespace == "period": - best_params = self.__optuna_period_params.get(pair, {}) + best_params = self.__optuna_period_params.get(pair) if best_params: study.enqueue_trial(best_params) else: diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index c748216..08ff72f 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -59,7 +59,7 @@ class QuickAdapterV3(IStrategy): INTERFACE_VERSION = 3 def version(self) -> str: - return "3.2.11" + return "3.2.12" timeframe = "5m" @@ -340,7 +340,7 @@ class QuickAdapterV3(IStrategy): return dataframe def get_label_period_candles(self, pair: str) -> int: - label_period_candles = self.__period_params.get(pair, {}).get( + label_period_candles = self.__period_params.get(pair).get( "label_period_candles" ) if label_period_candles: @@ -355,7 +355,7 @@ class QuickAdapterV3(IStrategy): peaks_prominence = ( dataframe["close"].iloc[-1] * ta.NATR(dataframe, timeperiod=label_period_candles).iloc[-1] - * 0.0025 + * 0.005 ) min_peaks, _ = find_peaks( -dataframe["low"].values,