Add period selector and crypto-style trend plan preview table.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 22:52:47 +08:00
parent d3b92de703
commit 24190bf679
6 changed files with 253 additions and 25 deletions
+6 -1
View File
@@ -61,7 +61,8 @@ CREATE TABLE IF NOT EXISTS trend_pullback_plans (
avg_entry_price REAL,
lots_open INTEGER DEFAULT 0,
opened_at TEXT,
message TEXT
message TEXT,
period TEXT DEFAULT '15m'
)
"""
@@ -138,6 +139,10 @@ def init_strategy_tables(conn) -> None:
CTP_SIM_POSITIONS_SQL,
):
conn.execute(sql)
try:
conn.execute("ALTER TABLE trend_pullback_plans ADD COLUMN period TEXT DEFAULT '15m'")
except Exception:
pass
if not conn.execute("SELECT id FROM ctp_sim_account WHERE id=1").fetchone():
conn.execute("INSERT INTO ctp_sim_account (id, balance, available) VALUES (1, 100000, 100000)")
conn.commit()