summaryrefslogtreecommitdiff
path: root/services/backtester/tests/test_walk_forward.py
diff options
context:
space:
mode:
Diffstat (limited to 'services/backtester/tests/test_walk_forward.py')
-rw-r--r--services/backtester/tests/test_walk_forward.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/backtester/tests/test_walk_forward.py b/services/backtester/tests/test_walk_forward.py
index 96abb6e..b1aa12c 100644
--- a/services/backtester/tests/test_walk_forward.py
+++ b/services/backtester/tests/test_walk_forward.py
@@ -1,18 +1,18 @@
"""Tests for walk-forward analysis."""
import sys
-from pathlib import Path
+from datetime import UTC, datetime, timedelta
from decimal import Decimal
-from datetime import datetime, timedelta, timezone
-
+from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "strategy-engine"))
-from shared.models import Candle
from backtester.walk_forward import WalkForwardEngine, WalkForwardResult
from strategies.rsi_strategy import RsiStrategy
+from shared.models import Candle
+
def _generate_candles(n=100, base_price=100.0):
candles = []
@@ -23,7 +23,7 @@ def _generate_candles(n=100, base_price=100.0):
Candle(
symbol="AAPL",
timeframe="1h",
- open_time=datetime(2025, 1, 1, tzinfo=timezone.utc) + timedelta(hours=i),
+ open_time=datetime(2025, 1, 1, tzinfo=UTC) + timedelta(hours=i),
open=Decimal(str(price)),
high=Decimal(str(price + 5)),
low=Decimal(str(price - 5)),