feat: add XRP and SOL symbols (4 coins total)
This commit is contained in:
parent
3155e8848b
commit
0ac2225979
@ -35,7 +35,7 @@ logging.basicConfig(
|
||||
logger = logging.getLogger("collector")
|
||||
|
||||
BINANCE_FAPI = "https://fapi.binance.com/fapi/v1"
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT"]
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
|
||||
HEADERS = {"User-Agent": "Mozilla/5.0 ArbitrageEngine/3.0"}
|
||||
|
||||
BATCH_SIZE = 200
|
||||
|
||||
@ -23,7 +23,7 @@ app.add_middleware(
|
||||
app.include_router(auth_router)
|
||||
|
||||
BINANCE_FAPI = "https://fapi.binance.com/fapi/v1"
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT"]
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
|
||||
HEADERS = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"}
|
||||
|
||||
# 简单内存缓存(history/stats 60秒,rates 3秒)
|
||||
@ -424,7 +424,7 @@ async def get_signal_indicators(
|
||||
@app.get("/api/signals/latest")
|
||||
async def get_signal_latest(user: dict = Depends(get_current_user)):
|
||||
result = {}
|
||||
for sym in ["BTCUSDT", "ETHUSDT"]:
|
||||
for sym in SYMBOLS:
|
||||
row = await async_fetchrow(
|
||||
"SELECT ts, cvd_fast, cvd_mid, cvd_day, cvd_fast_slope, atr_5m, atr_percentile, "
|
||||
"vwap_30m, price, p95_qty, p99_qty, score, signal "
|
||||
@ -440,7 +440,7 @@ async def get_signal_latest(user: dict = Depends(get_current_user)):
|
||||
async def get_market_indicators(user: dict = Depends(get_current_user)):
|
||||
"""返回最新的market_indicators数据(V5.1新增4个数据源)"""
|
||||
result = {}
|
||||
for sym in ["BTCUSDT", "ETHUSDT"]:
|
||||
for sym in SYMBOLS:
|
||||
indicators = {}
|
||||
for ind_type in ["long_short_ratio", "top_trader_position", "open_interest_hist", "coinbase_premium"]:
|
||||
row = await async_fetchrow(
|
||||
|
||||
@ -9,7 +9,7 @@ import aiohttp
|
||||
import psycopg2
|
||||
from psycopg2.extras import Json
|
||||
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT"]
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
|
||||
INTERVAL_SECONDS = 300
|
||||
|
||||
PG_HOST = os.getenv("PG_HOST", "127.0.0.1")
|
||||
|
||||
@ -34,7 +34,7 @@ logging.basicConfig(
|
||||
)
|
||||
logger = logging.getLogger("signal-engine")
|
||||
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT"]
|
||||
SYMBOLS = ["BTCUSDT", "ETHUSDT", "XRPUSDT", "SOLUSDT"]
|
||||
LOOP_INTERVAL = 15 # 秒(从5改15,CPU降60%,信号质量无影响)
|
||||
|
||||
# 窗口大小(毫秒)
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
ReferenceLine, CartesianGrid, Legend
|
||||
} from "recharts";
|
||||
|
||||
type Symbol = "BTC" | "ETH";
|
||||
type Symbol = "BTC" | "ETH" | "XRP" | "SOL";
|
||||
|
||||
interface IndicatorRow {
|
||||
ts: number;
|
||||
@ -456,7 +456,7 @@ export default function SignalsPage() {
|
||||
<p className="text-slate-500 text-xs mt-0.5">五层100分评分 + 市场拥挤度 + 环境确认</p>
|
||||
</div>
|
||||
<div className="flex gap-1.5">
|
||||
{(["BTC", "ETH"] as Symbol[]).map(s => (
|
||||
{(["BTC", "ETH", "XRP", "SOL"] as Symbol[]).map(s => (
|
||||
<button key={s} onClick={() => setSymbol(s)}
|
||||
className={`px-4 py-1.5 rounded-lg border text-sm font-medium transition-colors ${symbol === s ? "bg-blue-600 text-white border-blue-600" : "border-slate-200 text-slate-600 hover:border-blue-400"}`}>
|
||||
{s}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user