回测没有问题,模拟交易就报错。这是为何?
由supertrim258创建,最终由supertrim258 被浏览 70 用户
问题
回测没有问题,模拟交易就报错。这是为何?
ValueError Traceback (most recent call last)
<ipython-input-1-41293a04a4ae> in <module>
283 )
284
--> 285 m14 = M.advanced_auto_labeler.v2(
286 instruments=m1.data,
287 label_expr="""# #号开始的表示注释
/var/app/enabled/biglearning/module2/common/modulemanagerv2.cpython-38-x86_64-linux-gnu.so in biglearning.module2.common.modulemanagerv2.BigQuantModuleVersion.call()
/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-38-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker.module_invoke()
/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-38-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()
/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-38-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()
/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-38-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._module_run()
/var/app/enabled/biglearning/module2/modules/advanced_auto_labeler/v2/init.cpython-38-x86_64-linux-gnu.so in biglearning.module2.modules.advanced_auto_labeler.v2.init.BigQuantModule.run()
/var/app/enabled/bigexpr/impl/expression.cpython-38-x86_64-linux-gnu.so in bigexpr.impl.expression.evaluate()
/var/app/enabled/bigexpr/impl/expression.cpython-38-x86_64-linux-gnu.so in bigexpr.impl.expression.__evaluate_ast()
/var/app/enabled/bigexpr/impl/functions.cpython-38-x86_64-linux-gnu.so in bigexpr.impl.functions.UserFunctions.all_wbins()
/usr/local/python3/lib/python3.8/site-packages/pandas/core/reshape/tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest, duplicates, ordered)
271 raise ValueError("bins must increase monotonically.")
272
--> 273 fac, bins = _bins_to_cuts(
274 x,
275 bins,
/usr/local/python3/lib/python3.8/site-packages/pandas/core/reshape/tile.py in _bins_to_cuts(x, bins, right, labels, precision, include_lowest, dtype, duplicates, ordered)
397 if len(unique_bins) < len(bins) and len(bins) != 2:
398 if duplicates == "raise":
--> 399 raise ValueError(
400 f"Bin edges must be unique: {repr(bins)}"
401 f"You can drop duplicate edges by setting the 'duplicates' kwarg"
ValueError: Bin edges must be unique: array([-inf, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan, nan, nan, nan, inf]).
You can drop duplicate edges by setting the 'duplicates' kwarg
\