Oanda - Recreate get_open_orders()



  • I have a strategy that occasionally calls broker.get_orders_open()

    From what I see on the docs, OandaBroker does not have a method for get_orders_open().
    https://www.backtrader.com/docu/live/oanda/oanda.html

    So I assume I will have to re-create the functionality if I want to keep checking for open orders in a live environment.

    With that in mind please help me check if my understanding of what is needed is correct. I would need to:

    • Create a list / order book for storing orders.
    • Add the order object to the list once an order is submitted (add the returned order object from the buy/sell call to the list)
    • Remove the order object from the list once I receive a order.Completed notification.

    Do I still need to be aware of the warning not to manipulate the orders as mentioned in the link below? Or is that only applicable to orders managed through backtraders own broker class?

    https://www.backtrader.com/docu/broker.html?highlight=get_orders_open#backtrader.brokers.BackBroker.get_orders_open

    For clarity, I just want to track open orders for potentially cancelling them in the future (both for adjusting stops and entry orders).

    Thanks
    Dave


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.