-
Hello there, As per the documentation, orders are placed GTC and need to be cancelled manually if not filled . What would be the best way to do so if the order is not filled after the duration of one bar ? Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
kernc
Jan 5, 2022
Replies: 1 comment 3 replies
-
Best to look in the API reference. There is def next(self):
# Close previous bar's orders *before* opening any new ones
for order in self.orders:
order.cancel()
# Open new orders for this bar
... |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
julzKB
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Best to look in the API reference. There is
Strategy.orders
andOrder.cancel
, so something like this should work: