Skip to content

Commit ffdd2ff

Browse files
committed
V2.2.1: Membership & Billing, USDT TRC20 payment, VIP free indicators, AI Trading Radar, simplified strategy creation, system settings simplification, bug fixes and UI improvements
1 parent ae82cc0 commit ffdd2ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4036
-6042
lines changed

README.md

Lines changed: 153 additions & 392 deletions
Large diffs are not rendered by default.

README_CN.md

Lines changed: 0 additions & 674 deletions
This file was deleted.

README_JA.md

Lines changed: 0 additions & 630 deletions
This file was deleted.

README_KO.md

Lines changed: 0 additions & 643 deletions
This file was deleted.

README_TW.md

Lines changed: 0 additions & 644 deletions
This file was deleted.

backend_api_python/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
# QuantDinger Backend API Dockerfile
2-
FROM python:3.12-slim
2+
FROM python:3.12-slim-bookworm
33

44
# Set working directory
55
WORKDIR /app
66

7-
# Install system dependencies
8-
RUN apt-get update && apt-get install -y --no-install-recommends \
9-
gcc \
10-
libffi-dev \
7+
# Use HTTPS mirror and install minimal runtime dependencies.
8+
# Keep image lean to avoid long downloads of full compiler toolchains.
9+
RUN sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list.d/*.sources 2>/dev/null || true \
10+
&& apt-get update \
11+
&& apt-get install -y --no-install-recommends --fix-missing \
1112
curl \
13+
# Build deps (needed for some pyproject-based packages like ed25519-blake2b)
14+
build-essential \
15+
python3-dev \
16+
libffi-dev \
17+
libssl-dev \
1218
&& rm -rf /var/lib/apt/lists/*
1319

1420
# Copy dependency file
1521
COPY requirements.txt .
1622

1723
# Install Python dependencies
18-
RUN pip install --no-cache-dir -r requirements.txt
24+
RUN pip install --no-cache-dir --prefer-binary --timeout 120 -r requirements.txt \
25+
# Remove build deps to keep image small
26+
&& apt-get purge -y --auto-remove build-essential python3-dev libffi-dev libssl-dev \
27+
&& rm -rf /var/lib/apt/lists/*
1928

2029
# Copy application code
2130
COPY . .

backend_api_python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Flask-based backend for QuantDinger: market data, indicators, AI analysis, backt
44

55
## What you get
66

7-
- **Multi-market data layer**: factory-based providers (crypto / US stocks / CN&HK stocks / futures, etc.)
7+
- **Multi-market data layer**: factory-based providers (crypto / US stocks / forex / futures, etc.)
88
- **Indicators + backtesting**: persisted runs/history in PostgreSQL
99
- **AI multi-agent analysis**: optional web search + OpenRouter LLM integration
1010
- **Strategy runtime**: thread-based executor, with optional auto-restore on startup

backend_api_python/app/data/market_symbols_seed.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_hot_symbols(market: str, limit: int = 10) -> List[Dict]:
2828
Get hot symbols for a market.
2929
3030
Args:
31-
market: Market name (e.g., 'Crypto', 'USStock', 'AShare')
31+
market: Market name (e.g., 'Crypto', 'USStock', 'Forex')
3232
limit: Maximum number of results
3333
3434
Returns:
@@ -100,18 +100,12 @@ def search_symbols(market: str, keyword: str, limit: int = 20) -> List[Dict]:
100100

101101

102102
def _normalize_for_match(market: str, symbol: str) -> str:
103-
"""Normalize symbol for matching (padding digits for A-Share/H-Share)."""
103+
"""Normalize symbol for matching."""
104104
m = (market or '').strip()
105105
s = (symbol or '').strip().upper()
106106
if not m or not s:
107107
return s
108108

109-
# A-Share codes are usually 6 digits
110-
if m == 'AShare' and s.isdigit() and len(s) < 6:
111-
s = s.zfill(6)
112-
# H-Share codes are often 5 digits
113-
if m == 'HShare' and s.isdigit() and len(s) < 5:
114-
s = s.zfill(5)
115109
return s
116110

117111

backend_api_python/app/data_sources/__init__.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
- 熔断器保护 (circuit_breaker)
77
- 数据缓存 (cache_manager)
88
- 防封禁策略 (rate_limiter)
9-
- 多数据源自动切换 (data_manager)
109
"""
1110
from app.data_sources.factory import DataSourceFactory
1211
from app.data_sources.circuit_breaker import (
1312
CircuitBreaker,
14-
get_ashare_circuit_breaker,
1513
get_realtime_circuit_breaker
1614
)
1715
from app.data_sources.cache_manager import (
@@ -22,24 +20,16 @@
2220
)
2321
from app.data_sources.rate_limiter import (
2422
RateLimiter,
25-
get_eastmoney_limiter,
26-
get_tencent_limiter,
27-
get_akshare_limiter,
2823
get_random_user_agent,
2924
random_sleep,
3025
retry_with_backoff
3126
)
32-
from app.data_sources.data_manager import (
33-
AShareDataManager,
34-
get_ashare_data_manager
35-
)
3627

3728
__all__ = [
3829
# 工厂
3930
'DataSourceFactory',
4031
# 熔断器
4132
'CircuitBreaker',
42-
'get_ashare_circuit_breaker',
4333
'get_realtime_circuit_breaker',
4434
# 缓存
4535
'DataCache',
@@ -48,14 +38,7 @@
4838
'get_stock_info_cache',
4939
# 限流器
5040
'RateLimiter',
51-
'get_eastmoney_limiter',
52-
'get_tencent_limiter',
53-
'get_akshare_limiter',
5441
'get_random_user_agent',
5542
'random_sleep',
5643
'retry_with_backoff',
57-
# 数据管理器
58-
'AShareDataManager',
59-
'get_ashare_data_manager',
6044
]
61-

backend_api_python/app/data_sources/cache_manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def stats(self) -> Dict[str, Any]:
178178
# 全局缓存实例
179179
# ============================================
180180

181-
# A股实时行情缓存(20分钟TTL,全市场数据量大
182-
_ashare_realtime_cache = DataCache(
183-
name="ashare_realtime",
181+
# 实时行情缓存(20分钟TTL)
182+
_realtime_cache = DataCache(
183+
name="realtime",
184184
default_ttl=1200.0, # 20分钟
185-
max_size=6000 # 约5000+股票
185+
max_size=6000
186186
)
187187

188188
# K线数据缓存(5分钟TTL,按需缓存)
@@ -202,7 +202,7 @@ def stats(self) -> Dict[str, Any]:
202202

203203
def get_realtime_cache() -> DataCache:
204204
"""获取实时行情缓存"""
205-
return _ashare_realtime_cache
205+
return _realtime_cache
206206

207207

208208
def get_kline_cache() -> DataCache:

0 commit comments

Comments
 (0)