HF Trade模块期货回测如何实现无杠杆交易?
由franklili创建,最终由small_q 被浏览 15 用户
我使用HF Trade模块进行期货回测,不想使用杠杆,即100%保证金交易,如何设置限制呢?
如果在初始函数中使用context.set_max_leverage(1),运行时会报错:
2023-02-24 17:23:17.721561 strategy strategy exception:Traceback (most recent call last): File "bigtrader/strategy/engine.py", line 715, in bigtrader2.bigtrader.strategy.engine.StrategyEngine._call_strategy_func File "bigtrader/strategy/strategy_base.py", line 2169, in bigtrader2.bigtrader.strategy.strategy_base.StrategyBase.call_on_init File "<ipython-input-58-37caf9b99a13>", line 283, in m42_initialize_bigquant_run context.set_max_leverage(1) AttributeError: 'StrategyEx' object has no attribute 'set_max_leverage'
\