fix: 自选Tab显示策略数据(买入区间/信号/策略)+live_prices涨跌
This commit is contained in:
@@ -109,11 +109,12 @@ def api_watchlist():
|
||||
conn = sqlite3.connect("/home/hmo/MoFin/data/mofin.db")
|
||||
conn.row_factory = sqlite3.Row
|
||||
rows = conn.execute("""
|
||||
SELECT code, name, entry_low, entry_high, stop_loss, take_profit,
|
||||
timing_signal, action, price, rr_ratio, updated_at
|
||||
FROM holding_strategies
|
||||
WHERE status='active' AND decision_type='自选策略'
|
||||
ORDER BY code
|
||||
SELECT hs.code, hs.name, hs.entry_low, hs.entry_high, hs.stop_loss, hs.take_profit,
|
||||
hs.timing_signal, hs.action, lp.price, lp.change_pct, hs.rr_ratio, hs.updated_at
|
||||
FROM holding_strategies hs
|
||||
LEFT JOIN live_prices lp ON hs.code = lp.code
|
||||
WHERE hs.status='active' AND hs.decision_type='自选策略'
|
||||
ORDER BY hs.code
|
||||
""").fetchall()
|
||||
conn.close()
|
||||
stocks = [dict(r) for r in rows]
|
||||
|
||||
Reference in New Issue
Block a user