行情K线:分类主力选择、图表指标与布局稳定

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 18:23:39 +08:00
parent 65992eb35e
commit 404872007f
8 changed files with 644 additions and 114 deletions
+14 -1
View File
@@ -17,7 +17,7 @@ from flask import (
)
from werkzeug.security import check_password_hash, generate_password_hash
from symbols import search_symbols, ths_to_codes
from symbols import search_symbols, ths_to_codes, list_main_contracts_grouped
from contract_specs import calc_position_metrics
from fee_specs import (
calc_fee_breakdown,
@@ -381,10 +381,17 @@ def build_market_quote_payload(
codes = ths_to_codes(symbol)
if codes:
name = codes.get("name", symbol)
prev_close = None
if sina_code:
from market import fetch_raw_for_volume
raw = fetch_raw_for_volume(sina_code)
if raw and raw.get("prev_close") is not None:
prev_close = raw["prev_close"]
return {
"symbol": symbol,
"name": name,
"price": price,
"prev_close": prev_close,
}
@@ -639,6 +646,12 @@ def api_symbol_search():
return jsonify(search_symbols(q))
@app.route("/api/symbols/mains")
@login_required
def api_symbols_mains():
return jsonify(list_main_contracts_grouped())
@app.route("/api/key_prices")
@login_required
def api_key_prices():