IBrokers
IBrokers copied to clipboard
Problem in placing future order
trafficstars
Description
i try to place a future order on a future but it keeps popping error "2 10 200 No security definition has been found for the request ". It indicates problems with my contract specification. However, i can pull historical data and real time data successfully from the same contract.
Expected behavior
[Describe the behavior/output you expected]
Minimal, reproducible example
> placeOrder(tws,twsFuture("HSI",exch= "HKFE",expiry = "20190130"),twsOrder(reqIds(tws),orderType = "MKT",action = "SELL",totalQuantity = 1))
> reqMktData(tws,HSI,snapshot = T)
Session Info
2 10 200 No security definition has been found for the request
lastTimeStamp symbol bidSize bidPrice askPrice askSize lastPrice Volume Open High Low Close
1 2020-01-10 17:20:10 HSI 5 28656 28659 4 28658 151 28662 28663 28646 28658
Thanks for the report! Can you replicate this with the demo account, or does it only happen with your live/paper account?
After i logged in with the demo account, the code worked for both demo and paper account. But still i have no idea why the code didn't work previously even if i restart the workstation.