Solved1.93K views
2

有细心的同学已经注意到了,每次回测我的初始金额都是1000w,我该怎么让他设置的更小或者更大一点呢?

Selected answer as best
0

方法很简单,导入TqSim模块,然后在TqSim中传入指定金额参数,例如1000,即可指定账户金额,TqSim具体文档:https://doc.shinnytech.com/pysdk/latest/reference/tqsdk.sim.html?highlight=tqsim#tqsdk.sim.TqSim

api = TqApi(TqSim(1000), backtest=TqBacktest(start_dt=date(2018, 5, 1), end_dt=date(2018, 10, 1)))
Edited answer