Skip to content

Instantly share code, notes, and snippets.

@ypochien
Last active December 10, 2022 15:33
Show Gist options
  • Save ypochien/272f062d249e057322afbd6db0b51dce to your computer and use it in GitHub Desktop.
Save ypochien/272f062d249e057322afbd6db0b51dce to your computer and use it in GitHub Desktop.
刪除全部的委託單
api.update_status()
for idx,t in enumerate(api.list_trades()):
if t.status.status in [shioaji.constant.Status.PreSubmitted,shioaji.constant.Status.Submitted,shioaji.constant.Status.PartFilled] :
api.cancel_order(t,timeout=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment