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

duplicate order IDs #5

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments
Open

duplicate order IDs #5

GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I have some problems with order IDs.

placeOrder sometimes works, sometimes does not and I cannot find out why.

I think it has to do with the duplicate order IDs, which is the message I get 
when running portfolio <- 
twsPortfolioValue(reqAccountUpdates(tws),zero.pos=FALSE).

However I do not understand how those duplicate IDs can exist, if I am always 
using this sequence for the order creation:
"
  id <- reqIds(tws)
  placeOrder(tws, future.NameTrade, twsOrder(id, action = "SELL", totalQuantity = noFut, orderType = "MKT", goodAfterTime = "22:14:00 CET")) 
"

Thus, I always create new id. 

Once the duplicate order message appears, there is no way to execute orders 
programmatically from R, and I have to go manually to either Gateway or TWS and 
"reset API order id sequence".

Is there a programmatic way from R to reset API order id sequence? Or how to 
get from this situation? I would like everything to run automatically and not 
have to manually reset orders ever.

Thank you for a reply,

Jozef

Original issue reported on code.google.com by [email protected] on 5 Oct 2012 at 9:09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant