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

Virtual broker requires reason arg for cancel_pending_order method #20

Closed
bb01100100 opened this issue Jan 25, 2022 · 1 comment
Closed

Comments

@bb01100100
Copy link

bb01100100 commented Jan 25, 2022

I noticed that the virtual broker cancel_pending_order method had a mandatory reason parameter, but the Oanda broker does not have this parameter.

I think this means a strategy that wants to call self.broker.cancel_pending_order(order_id=123) would work in live trading but not in backtesting because the method signatures are different.

If the virtual_broker.py cancel_pending_order function had reason=None then this would solve the issue.

References:

  • autotrader/brokers/virtual/virtual_broker.py function cancel_pending_order(self, order_id, reason)
  • autotrader/brokers/oanda/Oanda.py function cancel_pending_order(self, order_id)
@bb01100100 bb01100100 changed the title close_trade method Mandatory reason needed for cancel_pending_order method Jan 25, 2022
@bb01100100 bb01100100 changed the title Mandatory reason needed for cancel_pending_order method Virtual broker requires reason arg for cancel_pending_order method Jan 25, 2022
@kieran-mackle
Copy link
Owner

Great suggestion, this was an oversight. Fixed in v0.5.30.

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