代码地址:
https://gitee.com/wenjianbao/stock_trader_robot
使用示例:
from framework.tonghuashun.trader_demo import TonghuashunTraderDemo print('连接客户端') trader = TonghuashunTraderDemo() trader.init() print('获取 当前可用资金') print(trader.get_balance()) # print('获取【持仓】当前持有的股票') # print(trader.get_position()) # print('获取【委托】未成交订单') # print(trader.get_active_orders()) # print('获取【成交】已成交订单') # print(trader.get_filled_orders()) # print('卖出股票') # print(trader.sell('002352', 100, 10)) # print('撤单') # print(trader.cancel(1682))