Monday, March 4, 2024

miniQMT自动交易

 https://blog.csdn.net/u010214511/article/details/130275793

http://dict.thinktrader.net/nativeApi/code_examples.html

1. Install Python 3.11.8

2. Install xtquant: pip install quant1x-xtquant

3. 

登录QMT极简模式,连接QMT客户端:

import random

from xtquant.xttrader import XtQuantTrader

path = r'C:\国金证券QMT交易端\userdata_mini'

session_id = int(random.randint(100000,999999))

xt_trader = XtQuantTrader(path, session_id)

xt_trader.start()

connect_result=xt_trader.connect()

print(connect_result)

if connect_result == 0:

print('Connected successfully!')

订阅账户:

acc = StockAccount('888XXXXXXX')

subscribe_result=xt_trader.subscribe(acc)

print(subscribe_result)

下单:

stock_code='000429.SZ'

order_id=xt_trader.order_stock(acc,stock_code,xtconstant.STOCK_BUY,100,xtconstant.FIX_PRICE,9.3)

xt_trader.cancel_order_stock(acc,1082384002)


    asset = xt_trader.query_stock_asset(acc)

    if asset:

        print("asset:")

        print("cash {0}".format(asset.cash))

Friday, March 1, 2024

Breakpoint will not currently be hit. No symbols have been loaded for this document

 For C# Reflection/Dynamic loading module, got the message "Breakpoint will not currently be hit. No symbols have been loaded for this document" when trying to debug.

Already clean solution and rebuild, the below works for me

In VS, go to Tools --> Options --> Debugging --> General, and then cancel the checks in front of [Enable "Only My Code"] and [Require source files to exactly match the original version]. But this method you may have tried.


https://stackoverflow.com/questions/75142437/vs-2022-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-for-t