开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Conditions on twsactivex API.... AGAIN :)


 

First of all, I hope this message finds you well.

Here we go again with an issue related to price conditions. It seems that I'm the only one person in the world using these conditions on the TwsActiveX API... I need to be able to send the order changes to the TWS every day at the first hour in the morning, so I'm not keeping the TWS and the excel always connected nor the computer turned on.

I think we have found another bug on IB, because the price condition doesn't get updated if you turn off the TWS and restart it again!

For the tests, I used the Excel sample IB provides:

1) On the sheet "Conditional Orders" and after connecting to TWS I sent a MKT order on IBM stock with price condition:
"last of bid/ask Price of 37018770(SMART) is >= 30" (conid 37018770 is T stock)

After placing the focus on the row and clicking on the "Place /Modify Order" button, the order is sent and the Order Id is set on T column "Id" so we can resend the order and update the price condition. The result was as expected on TWS.

2) Update the price condition to:
"last of bid/ask Price of 37018770(SMART) is >= 32"

again after clicking on the button to send this modification, the result was right on TWS.

3) Now turn off the TWS and the excel

4) turn on again the TWS and the excel

5) Update the price condition to:
"last of bid/ask Price of 37018770(SMART) is >= 30"
?
After clicking on the button the modification is not sent, well I've taken a look at the API log and it is sent but the order is not modified on TWS and no error returned, so it is not working as expected.

Any clues on this? What can I do or?test?

I attach the excel demo workbook with the test row as explained here and the api log which shows the order is sent to the TWS and an answer comes from it with the price unchanged

Thank you very much

Join [email protected] to automatically receive all group messages.