Add configurable data providers and localize frontend UI
This commit is contained in:
22
backend/tests/test_technical_signals.py
Normal file
22
backend/tests/test_technical_signals.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Tests for structured technical analyzer."""
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from backend.tools.technical_signals import StockTechnicalAnalyzer
|
||||
|
||||
|
||||
def test_technical_analyzer_detects_bullish_trend():
|
||||
df = pd.DataFrame(
|
||||
{
|
||||
"time": pd.date_range("2024-01-01", periods=40, freq="D"),
|
||||
"close": [100 + i for i in range(40)],
|
||||
},
|
||||
)
|
||||
analyzer = StockTechnicalAnalyzer()
|
||||
|
||||
result = analyzer.analyze("AAPL", df)
|
||||
|
||||
assert result.current_price == 139.0
|
||||
assert result.trend in {"BULLISH", "STRONG BULLISH"}
|
||||
assert result.momentum_20d_pct > 0
|
||||
Reference in New Issue
Block a user