kieran-mackle / AutoTrader

A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
https://kieran-mackle.github.io/AutoTrader/
GNU General Public License v3.0
945 stars 217 forks source link

Virtual broker requires reason arg for cancel_pending_order method #20

Closed bb01100100 closed 2 years ago

bb01100100 commented 2 years ago

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:

kieran-mackle commented 2 years ago

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