Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send_order失败后的处理(没有重试?) #24

Open
qingsuijiu opened this issue Nov 21, 2022 · 4 comments
Open

send_order失败后的处理(没有重试?) #24

qingsuijiu opened this issue Nov 21, 2022 · 4 comments

Comments

@qingsuijiu
Copy link

hello,我看到很多基础下单函数(buy、short等)最后都会调用send_order函数。而send_order如果失败(eg. Timestamp for this request is outside of the recvWindow.),好像并不会重试,这块有考虑过优化吗。

@51bitquant
Copy link
Owner

hello,我看到很多基础下单函数(buy、short等)最后都会调用send_order函数。而send_order如果失败(eg. Timestamp for this request is outside of the recvWindow.),好像并不会重试,这块有考虑过优化吗。

如果下单失败,那么有可能是资金不足或者时间戳等问题导致的,如果是时间戳不准,那么会同步下服务器时间,同时订单的状态会推送到策略的on_order, 具体你可以重新自己管理或者重新下单,这个交给策略是做。

@qingsuijiu
Copy link
Author

qingsuijiu commented Nov 21, 2022 via email

@51bitquant
Copy link
Owner

感谢您的解答!另外,有个小建议,希望send_order之类基础函数的各个参数(比如offset、lock等,我没看明白,网上也搜不到相关资料),能有个简单的注释,说明下参数的意义。个人愚见,再次感谢解答!

---原始邮件--- 发件人: @.> 发送时间: 2022年11月21日(周一) 下午3:30 收件人: @.>; 抄送: @.@.>; 主题: Re: [51bitquant/howtrader] send_order失败后的处理(没有重试?) (Issue #24) hello,我看到很多基础下单函数(buy、short等)最后都会调用send_order函数。而send_order如果失败(eg. Timestamp for this request is outside of the recvWindow.),好像并不会重试,这块有考虑过优化吗。 如果下单失败,那么有可能是资金不足或者时间戳等问题导致的,如果是时间戳不准,那么会同步下服务器时间,同时订单的状态会推送到策略的on_order, 具体你可以重新自己管理或者重新下单,这个交给策略是做。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

网易云课堂上有讲。send_ordr 主要是要把下单的数量和价格发送过去,另外offset只是针对国内的期货开平而已,一般没啥用。币圈的就是买和卖,你有空单,你买了,就是做多,如果你买的数量和持仓的一致,就是平仓。不要把国内那种交易规则什么平多平空,就简单就是买卖就完事了。

@qingsuijiu
Copy link
Author

qingsuijiu commented Nov 23, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants