]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
perf(qav3): fine tune extrema labeling
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 5 Apr 2025 10:36:36 +0000 (12:36 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 5 Apr 2025 10:36:36 +0000 (12:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/docs/labeling_window.txt
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py

index d65c8aad679a703715cedffece49ee39dc99bd4a..b43d884a83d91654e0f6bee8fa073360ea433c63 100644 (file)
@@ -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
index ea9f6dde6517fe128f640c232301e3f91f677e41..3796294738408a11edfd96780503d16b910110bb 100644 (file)
@@ -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:
index c748216f02071154bb949b53b051d7411678fd09..08ff72f51e25e4657c1fa8ab7d32ad0beefb849b 100644 (file)
@@ -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,