OandaStore: order.Completed not received for Stop orders
-
Hello.
I am not receiving order.Completed notifications for stop orders submitted when using the oanda store.To verify I tested using oandatest
I do receive the order.Completed notifications when using a market order.
.tests$ python3 oandatest.py --account REMOVED --token REMOVED --data0 GBP_USD --resample --timeframe Minutes --compression 1 --no-backfill_start --stake 1000 --exectype Stop --trade --broker -------------------------------------------------- Strategy Created -------------------------------------------------- -- Contract Details: {'displayName': 'GBP/USD', 'instrument': 'GBP_USD', 'maxTradeUnits': 10000000, 'pip': '0.0001'} Datetime, Open, High, Low, Close, Volume, OpenInterest, SMA ***** DATA NOTIF: LIVE Data0, 0001, 736430.293056, 2017-04-11T07:02:00.000000, 1.241420, 1.241420, 1.241360, 1.241360, 0, 0, nan -------------------------------------------------- ORDER BEGIN 2017-04-11 15:03:00.307367 Ref: 1 OrdType: 0 OrdType: Buy Status: 1 Status: Submitted Size: 1000 Price: 1.2363600000000001 Price Limit: None TrailAmount: None TrailPercent: None ExecType: 3 ExecType: Stop CommInfo: <backtrader.comminfo.CommInfoBase object at 0x7fd4ca4e1940> End of Session: 736430.9999999999 Info: AutoOrderedDict([('oco', None), ('parent', None), ('transmit', True), ('trailpercent', None), ('trailamount', None)]) Broker: <backtrader.brokers.oandabroker.OandaBroker object at 0x7fd4c8cbb908> Alive: True -------------------------------------------------- ORDER END -------------------------------------------------- ORDER BEGIN 2017-04-11 15:03:00.307626 Ref: 1 OrdType: 0 OrdType: Buy Status: 2 Status: Accepted Size: 1000 Price: 1.2363600000000001 Price Limit: None TrailAmount: None TrailPercent: None ExecType: 3 ExecType: Stop CommInfo: <backtrader.comminfo.CommInfoBase object at 0x7fd4ca4e1940> End of Session: 736430.9999999999 Info: AutoOrderedDict([('oco', None), ('parent', None), ('transmit', True), ('trailpercent', None), ('trailamount', None)]) Broker: None Alive: True -------------------------------------------------- ORDER END Data0, 0002, 736430.293750, 2017-04-11T07:03:00.000000, 1.241370, 1.241560, 1.241210, 1.241390, 0, 0, nan Data0, 0003, 736430.294444, 2017-04-11T07:04:00.000000, 1.241390, 1.241440, 1.241140, 1.241190, 0, 0, nan Data0, 0004, 736430.295139, 2017-04-11T07:05:00.000000, 1.241110, 1.241300, 1.241000, 1.241210, 0, 0, nan Data0, 0005, 736430.295833, 2017-04-11T07:06:00.000000, 1.241130, 1.241170, 1.241080, 1.241100, 0, 0, 1.241250
Note the stop order is being triggered as I verified on Oanda's fxTrade platform.
-
This was mentioned in another thread, but it seems that the finishing touches of the REST v20 API of Oanda brought some changes to the original REST API.
The commit made there is the culprit (although the last message sent by Oanda,
ORDER_CANCEL
, after having filled the order doesn't help)Use the latest commit available as of now in the master branch
https://github.com/mementum/backtrader/commit/3255ff687cbc41a2e442e6b1c59da4d18c662a7f
-
Released today in
1.9.41.116
-
Thanks! I will take a look.