add stock name to get_today_trades

This commit is contained in:
zhiyong 2025-04-29 01:29:17 +08:00
parent cb70c5378a
commit 0a1fe76218

View File

@ -6,6 +6,7 @@ from config import Config
from xtquant.xttrader import XtQuantTrader from xtquant.xttrader import XtQuantTrader
from xtquant.xttype import StockAccount from xtquant.xttype import StockAccount
from xtquant import xtconstant from xtquant import xtconstant
from xtquant.xtdata import get_instrument_detail
# 日志配置 # 日志配置
LOG_DIR = "log" LOG_DIR = "log"
@ -122,6 +123,7 @@ class XtTrader:
{ {
"account_id": t.account_id, "account_id": t.account_id,
"stock_code": t.stock_code, "stock_code": t.stock_code,
"stock_name": get_instrument_detail(t.stock_code)["InstrumentName"] if get_instrument_detail(t.stock_code) else "",
"order_id": t.order_id, "order_id": t.order_id,
"traded_id": t.traded_id, "traded_id": t.traded_id,
"traded_time": t.traded_time, "traded_time": t.traded_time,