|
@@ -15,7 +15,7 @@ from xtquant import xtdata
|
|
auth('18616891214', 'Ea?*7f68nD.dafcW34d!')
|
|
auth('18616891214', 'Ea?*7f68nD.dafcW34d!')
|
|
# auth('18521506014', 'Abc123!@#')
|
|
# auth('18521506014', 'Abc123!@#')
|
|
#启动交易系统
|
|
#启动交易系统
|
|
-path = 'D:\\安信证券QMT实盘_交易终端\\userdata_mini'
|
|
|
|
|
|
+path = 'c:\\qmt\\userdata_mini'
|
|
# session_id为会话编号,策略使用方对于不同的Python策略需要使用不同的会话编号
|
|
# session_id为会话编号,策略使用方对于不同的Python策略需要使用不同的会话编号
|
|
session_id = 20221123
|
|
session_id = 20221123
|
|
|
|
|
|
@@ -161,6 +161,7 @@ while True:
|
|
try:
|
|
try:
|
|
df_stock = get_bars(stock, count=60, unit=fre, fields=['date', 'open', 'close', 'high', 'low','volume'],
|
|
df_stock = get_bars(stock, count=60, unit=fre, fields=['date', 'open', 'close', 'high', 'low','volume'],
|
|
include_now=True, df=True)
|
|
include_now=True, df=True)
|
|
|
|
+ print('time=', df_stock.iloc[-1].at['date'])
|
|
price = df_stock.iloc[-1].at['close']
|
|
price = df_stock.iloc[-1].at['close']
|
|
price_open = df_stock.iloc[-1].at['open']
|
|
price_open = df_stock.iloc[-1].at['open']
|
|
MA5_1 = df_stock['close'][-7:-2].mean()
|
|
MA5_1 = df_stock['close'][-7:-2].mean()
|