diff options
Diffstat (limited to 'tests/integration/test_backtest_end_to_end.py')
| -rw-r--r-- | tests/integration/test_backtest_end_to_end.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/integration/test_backtest_end_to_end.py b/tests/integration/test_backtest_end_to_end.py index 4bdb5f3..4a484f5 100644 --- a/tests/integration/test_backtest_end_to_end.py +++ b/tests/integration/test_backtest_end_to_end.py @@ -1,12 +1,14 @@ """Integration test: full backtest with real strategy on generated candles.""" + import sys from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "services" / "strategy-engine" / "src")) +sys.path.insert( + 0, str(Path(__file__).resolve().parents[2] / "services" / "strategy-engine" / "src") +) sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "services" / "strategy-engine")) sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "services" / "backtester" / "src")) -import pytest from decimal import Decimal from datetime import datetime, timedelta, timezone @@ -17,10 +19,13 @@ from backtester.engine import BacktestEngine def _generate_candles(prices: list[float], symbol="BTCUSDT") -> list[Candle]: return [ Candle( - symbol=symbol, timeframe="1h", + symbol=symbol, + timeframe="1h", open_time=datetime(2025, 1, 1, tzinfo=timezone.utc) + timedelta(hours=i), - open=Decimal(str(p)), high=Decimal(str(p + 100)), - low=Decimal(str(p - 100)), close=Decimal(str(p)), + open=Decimal(str(p)), + high=Decimal(str(p + 100)), + low=Decimal(str(p - 100)), + close=Decimal(str(p)), volume=Decimal("100"), ) for i, p in enumerate(prices) |
