summaryrefslogtreecommitdiff
path: root/shared/tests/test_models.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 18:45:12 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 18:45:12 +0900
commitcf02d18ea5e3f9357d6a02faac199f57e5daff77 (patch)
treef36e0c6347520f6363da45479a80e6aa73ad986e /shared/tests/test_models.py
parentcb55c81dbc43df83ef4d5b717fe22b4d04a93d2e (diff)
feat(strategy): Phase 2 complete — strategy infrastructure upgrade
- Technical indicators library (ATR, ADX, RSI, MACD, Bollinger, Stochastic, OBV) - Signal model: conviction score, stop_loss, take_profit fields - BaseStrategy: ADX regime filter, volume confirmation, ATR-based stops - All 8 strategies upgraded with filters, conviction scoring, ATR stops - Combined strategy uses conviction-weighted scoring - 334 tests passing
Diffstat (limited to 'shared/tests/test_models.py')
-rw-r--r--shared/tests/test_models.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/shared/tests/test_models.py b/shared/tests/test_models.py
index b23d71d..e3b9f12 100644
--- a/shared/tests/test_models.py
+++ b/shared/tests/test_models.py
@@ -99,8 +99,12 @@ def test_signal_conviction_default():
from shared.models import Signal, OrderSide
signal = Signal(
- strategy="rsi", symbol="BTCUSDT", side=OrderSide.BUY,
- price=Decimal("50000"), quantity=Decimal("0.01"), reason="test",
+ strategy="rsi",
+ symbol="BTCUSDT",
+ side=OrderSide.BUY,
+ price=Decimal("50000"),
+ quantity=Decimal("0.01"),
+ reason="test",
)
assert signal.conviction == 1.0
assert signal.stop_loss is None
@@ -112,8 +116,12 @@ def test_signal_with_stops():
from shared.models import Signal, OrderSide
signal = Signal(
- strategy="rsi", symbol="BTCUSDT", side=OrderSide.BUY,
- price=Decimal("50000"), quantity=Decimal("0.01"), reason="test",
+ strategy="rsi",
+ symbol="BTCUSDT",
+ side=OrderSide.BUY,
+ price=Decimal("50000"),
+ quantity=Decimal("0.01"),
+ reason="test",
conviction=0.8,
stop_loss=Decimal("48000"),
take_profit=Decimal("55000"),