]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(reforcexy): cache properties
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 23 Apr 2025 16:49:36 +0000 (18:49 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 23 Apr 2025 16:49:36 +0000 (18:49 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ReforceXY/user_data/strategies/RLAgentStrategy.py

index 7458c4763068a828319683f820ebb5864dc022fe..81feb875244b0f3136a065278b144371fc86a715 100644 (file)
@@ -1,5 +1,5 @@
 import logging
-from functools import reduce
+from functools import cached_property, reduce
 
 # import talib.abstract as ta
 from pandas import DataFrame
@@ -32,7 +32,7 @@ class RLAgentStrategy(IStrategy):
 
     startup_candle_count: int = 300
 
-    # @property
+    # @cached_property
     # def protections(self):
     #     fit_live_predictions_candles = self.freqai_info.get(
     #         "fit_live_predictions_candles", 100
@@ -55,7 +55,7 @@ class RLAgentStrategy(IStrategy):
     #         },
     #     ]
 
-    @property
+    @cached_property
     def can_short(self):
         return self.is_short_allowed()