merge annotate /ANNOTATE/core into /core.

fix chart updates
This commit is contained in:
Dobromir Popov
2025-12-10 14:07:14 +02:00
parent e0d0471e8a
commit bfaba556ea
23 changed files with 1074 additions and 1214 deletions

54
test_chart_data_fix.py Normal file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env python3
"""
Test script to verify chart data API works after refactoring
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from core.data_provider import DataProvider
from core.config import get_config
def test_chart_data():
"""Test that data provider can provide chart data for annotation UI"""
print("Testing chart data after ANNOTATE/core refactoring...")
print("-" * 50)
try:
# Initialize config and data provider
config = get_config()
data_provider = DataProvider(config)
print("✅ DataProvider initialized successfully")
# Test the annotation-specific method
symbol = 'ETH/USDT'
timeframe = '1m'
limit = 10
print(f"\nTesting get_data_for_annotation({symbol}, {timeframe}, limit={limit})...")
df = data_provider.get_data_for_annotation(
symbol=symbol,
timeframe=timeframe,
limit=limit,
direction='latest'
)
if df is not None and not df.empty:
print(f"✅ Got {len(df)} candles")
print(f" Latest timestamp: {df.index[-1]}")
print(f" Latest close: {df.iloc[-1]['close']}")
print("✅ Chart data API working correctly!")
else:
print("❌ No data returned")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_chart_data()