Closed Boolin365 closed 4 years ago
btoandav20 will restore the open positions when starting. It will open a trade with the total amount of open position for every instrument.
Take a look at the use_positions parameter for the broker
orders which are not filled, will not get restored.
orders which are not filled, will not get restored.
I see. I am using the "use_positions=True" parameter in the broker instance, but as I explained and you covered above, this only repopulates the existing executed/filled orders - which for brackets is only the mainside order.
Please correct me if I'm wrong, but the Oanda V20 API does allow to retrieve all open orders for an account. Would it be possible to get support in btoandav20 for this, as I cannot see a way to continue without being able to repopulate my open orders upon script resumption?
BTW, other than this "issue", I absolutely applaud you for your effort in providing this package.
orders which are not filled, will not get restored.
I see. I am using the "use_positions=True" parameter in the broker instance, but as I explained and you covered above, this only repopulates the existing executed/filled orders - which for brackets is only the mainside order.
Please correct me if I'm wrong, but the Oanda V20 API does allow to retrieve all open orders for an account. Would it be possible to get support in btoandav20 for this, as I cannot see a way to continue without being able to repopulate my open orders upon script resumption?
You are right, it will not restore all but only the positions open (they may be opened by different trades). So it will create one trade with the total amount of open positions. You would have to do it manually. The problem is restoring the order.ref (so you know in backtrader which orders belong together).
You would basically fetch all open trades before start and then create the trades according your needs.
Please correct me if I'm wrong, but the Oanda V20 API does allow to retrieve all open orders for an account. Would it be possible to get support in btoandav20 for this, as I cannot see a way to continue without being able to repopulate my open orders upon script resumption?
You can access the oanda api by using the store:
store.oapi
This is the oanda v20 connection object.
You can find examples for the v20 api access here:
Hope this helps you.
Hello, I've some confuse about this issue.
IMHO, the issue #15 and this issue are vary similar, and the the README shows that this project is available to Replace pending orders. So I'm not sure if the pending orders are reproduced or not.
@happydasch Can you give more details? It seems that I misunderstand the "Replace pending orders" means.
thank you!
@k0286 i am not really sure about your question. for pending orders, these are orders which are not filled yet. so there is no trade open yet or which were not filled yet like SL or TP orders for open trades.
what will not be possible is recreating orders bbetween different instances. so if you close a running instance of backtrader, it will not be possible to recreate all pending orders (which are not filled yet). it is only possible to recreate open trades without any information of pending orders.
@k0286 i am not really sure about your question. for pending orders, these are orders which are not filled yet. so there is no trade open yet or which were not filled yet like SL or TP orders for open trades.
Thanks for your reply!
According to your description, bto store doesn't synchronize the trades/orders history or states from the oanda server side.
So if I want to check whether the pending orders on the server side are existed or not, the only way is to call oapi
manually, right?
So if I want to check whether the pending orders on the server side are existed or not, the only way is to call
oapi
manually, right?
Yes, correct
Hi, I would like to know if there is some way to get open orders on start-up?
My example is this:
I would like to be able to re-populate my order book with the currently open orders per data every time I run the script. Is this possible, any help?
Thanks in advance.