summaryrefslogtreecommitdiff
path: root/services/strategy-engine/tests
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:28:14 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:28:14 +0900
commit72d29b4798f2594465f384982f0fc932a1f6c880 (patch)
treea140c639f8595f9631e49f30f38996044b9d3f5f /services/strategy-engine/tests
parent23e60d37f8f55386ab7c1378a50db11a9c386dc6 (diff)
fix: lint cleanup for API, combined strategy, and formatting
Diffstat (limited to 'services/strategy-engine/tests')
-rw-r--r--services/strategy-engine/tests/test_combined_strategy.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/services/strategy-engine/tests/test_combined_strategy.py b/services/strategy-engine/tests/test_combined_strategy.py
index b860dca..3408a89 100644
--- a/services/strategy-engine/tests/test_combined_strategy.py
+++ b/services/strategy-engine/tests/test_combined_strategy.py
@@ -1,6 +1,8 @@
"""Tests for Combined strategy."""
+
import sys
from pathlib import Path
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from decimal import Decimal
@@ -24,9 +26,12 @@ class AlwaysBuyStrategy(BaseStrategy):
def on_candle(self, candle: Candle) -> Signal | None:
return Signal(
- strategy=self.name, symbol=candle.symbol,
- side=OrderSide.BUY, price=candle.close,
- quantity=Decimal("0.01"), reason="always buy",
+ strategy=self.name,
+ symbol=candle.symbol,
+ side=OrderSide.BUY,
+ price=candle.close,
+ quantity=Decimal("0.01"),
+ reason="always buy",
)
@@ -42,9 +47,12 @@ class AlwaysSellStrategy(BaseStrategy):
def on_candle(self, candle: Candle) -> Signal | None:
return Signal(
- strategy=self.name, symbol=candle.symbol,
- side=OrderSide.SELL, price=candle.close,
- quantity=Decimal("0.01"), reason="always sell",
+ strategy=self.name,
+ symbol=candle.symbol,
+ side=OrderSide.SELL,
+ price=candle.close,
+ quantity=Decimal("0.01"),
+ reason="always sell",
)
@@ -64,10 +72,13 @@ class NeutralStrategy(BaseStrategy):
def _candle(price=100.0):
return Candle(
- symbol="BTCUSDT", timeframe="1m",
+ symbol="BTCUSDT",
+ timeframe="1m",
open_time=datetime(2025, 1, 1, tzinfo=timezone.utc),
- open=Decimal(str(price)), high=Decimal(str(price+10)),
- low=Decimal(str(price-10)), close=Decimal(str(price)),
+ open=Decimal(str(price)),
+ high=Decimal(str(price + 10)),
+ low=Decimal(str(price - 10)),
+ close=Decimal(str(price)),
volume=Decimal("10"),
)