返回列表 发布新帖

新手,试了好几个下单函数,但是发生错误,怎么解决

max_stock = 159915.SZ order_percent(max_stock, 1, ContextInfo,'test')

159915是创业板ETF。我用的是策略回测

【2025-06-12 17:47:09.443】 start back test mode 【2025-06-12 17:47:09.443】 0E:\QMT\国金证券QMT交易端\python\新建策略文件.py_SH51030011ArgumentError:Python argument types in main.order_percent(float, int, Boost.Python.class, str) did not match C++ signature: order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int) 【2025-06-12 17:47:09.444】 Traceback (most recent call last):

File "<string>", line 49, in handlebar

Boost.Python.ArgumentError: Python argument types in main.order_percent(float, int, Boost.Python.class, str) did not match C++ signature: order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) order_percent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, double, class boost::python::api::object, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int)

评论1

*******0020_e2rwT
发表于 前天 16:42 | 显示全部楼层
max_stock = 159915.SZ,变量应该是字符串,你检查一下

回复

您需要登录后才可以回帖 登录 | 立即注册

客服专线

400-080-8112

用思考的速度交易,用真诚的态度合作,我们是认真的!
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2025 迅投QMT社区 版权所有 All Rights Reserved. 京ICP备2025122616号-3
关灯 快速发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表