输出增加股票名称

This commit is contained in:
lzybetter
2026-07-10 14:42:51 +08:00
parent 0ae7f38f20
commit 8d6f7430bd
2 changed files with 8 additions and 2 deletions
+8
View File
@@ -51,8 +51,16 @@ class TelegramQuantStateMachine(QuantStateMachine):
next_state, comment = StateRuleBook.evaluate_next_state(self.current_state, f)
self.current_state = next_state
conn = sqlite3.connect(DB_FILE)
cursor = conn.cursor()
cursor.execute("SELECT stock_name FROM watchlist WHERE is_active = 1 and stock_code = ?", (self.stock_code,))
row = cursor.fetchone()
conn.close()
name = row[0] if row else "unknow"
msg = f"📊 *【量化做T复盘报告】* \n"
msg += f"🤖 股票代码: `{self.stock_code}`\n"
msg += f"🤖 股票名称: `{name}`\n"
msg += f"🕒 诊断时间: {datetime.now().strftime('%Y-%m-%d %H:%M')}\n"
msg += f"📈 因子: `%B`={f['percent_b']:.2f} | 分时偏离={f['min_bias']:.2%} | 带宽分位={f['bw_quantile']:.2%}\n"
msg += f"🔍 状态: *{self.current_state}*\n"