easytrader
easytrader copied to clipboard
使用flask调用position,grid_strategies模式有几率卡在保存文件弹出框,文件保存不成功
env
OS: win2012 PYTHON_VERSION: 3.x EASYTRADER_VERSION: 0.xx.xx BROKER_TYPE: gj / ht / xq / xxx
problem
how to repeat
@app.route('/ths_position')
def ths_position():
user = easytrader.use('ths')
user.grid_strategy = grid_strategies.Xls
user.grid_strategy_instance.tmp_folder = 'C:\\custom_folder'
user.connect(r'C:\中信证券至胜全能版\xiadan.exe') # 类似 r'C:\htzqzyb2\xiadan.exe'
return json.dumps(user.position, ensure_ascii=False)