]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix: handle margin trading mode
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 25 Mar 2025 15:42:59 +0000 (16:42 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 25 Mar 2025 15:42:59 +0000 (16:42 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ReforceXY/user_data/strategies/RLAgentStrategy.py
quickadapter/user_data/strategies/QuickAdapterV3.py

index 5a817903f5814e622ee29bae97f54f1d198fe8f0..7049e1d9c8ca65a03a3ba760fc617e34469dec20 100644 (file)
@@ -125,7 +125,7 @@ class RLAgentStrategy(IStrategy):
 
     def is_short_allowed(self) -> bool:
         trading_mode = self.config.get("trading_mode")
-        if trading_mode == "futures":
+        if trading_mode == "margin" or trading_mode == "futures":
             return True
         elif trading_mode == "spot":
             return False
index c53ae58411e79bd9d957a69581876a237bf1d3ec..0e2204cfca9c622f95a64e1b52e0952b3cb6a8dd 100644 (file)
@@ -645,7 +645,7 @@ class QuickAdapterV3(IStrategy):
 
     def is_short_allowed(self) -> bool:
         trading_mode = self.config.get("trading_mode")
-        if trading_mode == "futures":
+        if trading_mode == "margin" or trading_mode == "futures":
             return True
         elif trading_mode == "spot":
             return False