51bitquant / howtrader

Howtrader: A crypto quant framework for developing, backtesting, and executing your own trading strategies. Seamlessly integrates with TradingView and other third-party signals. Simply send a post request to automate trading and order placement. Supports Binance and Okex exchanges.
MIT License
665 stars 288 forks source link

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

Open qingsuijiu opened 1 year ago

qingsuijiu commented 1 year ago

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

51bitquant commented 1 year ago

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

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

qingsuijiu commented 1 year ago

感谢您的解答!另外,有个小建议,希望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: @.***>

51bitquant commented 1 year ago

感谢您的解答!另外,有个小建议,希望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 commented 1 year ago

嗯嗯 感谢指点

---原始邮件--- 发件人: @.> 发送时间: 2022年11月23日(周三) 中午11:05 收件人: @.>; 抄送: @.**@.>; 主题: Re: [51bitquant/howtrader] send_order失败后的处理(没有重试?) (Issue #24)

感谢您的解答!另外,有个小建议,希望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只是针对国内的期货开平而已,一般没啥用。币圈的就是买和卖,你有空单,你买了,就是做多,如果你买的数量和持仓的一致,就是平仓。不要把国内那种交易规则什么平多平空,就简单就是买卖就完事了。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>