IB tws is sending back a null/empty field when it should be a float
Anyone seen this behavior before seems that IB send out a null field when it usually is a float? thanks
tickPrice2: AAPL CLOSE 172.39 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL OPEN 172.76 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL BID 172.8 23.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickPrice2: AAPL ASK 172.81 33.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickSize: 1 BID_SIZE 23.0
tickSize: 1 ASK_SIZE 33.0
tickString: 1 BID_EXCH KPQXZU
tickString: 1 ASK_EXCH KPQZNU
marketDataType: 2 REALTIME
tickReqParams: 2 0.01 9c0001 3
©° Error: exception thrown
©¦ e = TypeError: in typeassert, expected Float64, got a value of type Nothing
|
Re: Conditions on twsactivex api
I would love to give you a hand, but I have two disqualifying conditions:
- I do not reside in Deutschland or anywhere in Europe
- but more importantly, we are satisfied LibreOffice/OpenOffice Calc users and don't have access to an MS Excel installation.
Your issue could very well be related to the fact that your Excel uses a non-US locale (time, date, number formats, thousands separators) that results in a string that is parsed incorrectly. Since the ActiveX plugin ignores locale specific decimal and thousands separators, have you tried changing the locale for the spreadsheet explicitly to en_US? Or just for the cells in the order placement work sheet?
Also, which version of Excel are you using?
´³¨¹°ù²µ±ð²Ô
|
Re: Conditions on twsactivex api
I understand your wish to get someone else to try this, and hopefully someone will. ? But I'd be happy to take a look at the actual spreadsheet you're using and see if it has the same results on my computer. If you'd like me to do this, just email it to me. ? ? ?
toggle quoted message
Show quoted text
From: [email protected] <[email protected]> On Behalf Of joanmarcel119 Sent: 07 February 2022 21:43 To: [email protected] Subject: Re: [TWS API] Conditions on twsactivex api? Hi Richard, thank you for all your help and support. I did not try again your settings because I was a bit busy and a bit disappointed about this behaviour of the API.? I would like some other one in the group that resides or lives currently in Europe,? (maybe ´³¨¹°ù²µ±ð²Ô lives in Germany / vielleicht wohnst Du in Deutschland, ´³¨¹°ù²µ±ð²Ô?) to check if this person also gets the same results as me or I'm the only one. I'm also planning on installing the API & TWS on my wife's computer and checking what she gets, maybe my computer has something wrong ...? For me these results are very very weird, If I try all your tests without the?decimal point and keeping my settings they?always work but when I add the point then I get the same error message. I will try to go forward with other computers tests this week and keep you informed
|
Re: Conditions on twsactivex api
Hi Richard, thank you for all your help and support.
I did not try again your settings because I was a bit busy and a bit disappointed about this behaviour of the API.? I would like some other one in the group that resides or lives currently in Europe,? (maybe ´³¨¹°ù²µ±ð²Ô lives in Germany / vielleicht wohnst Du in Deutschland, ´³¨¹°ù²µ±ð²Ô?) to check if this person also gets the same results as me or I'm the only one. I'm also planning on installing the API & TWS on my wife's computer and checking what she gets, maybe my computer has something wrong ...?
For me these results are very very weird, If I try all your tests without the?decimal point and keeping my settings they?always work but when I add the point then I get the same error message.
I will try to go forward with other computers tests this week and keep you informed
Best wishes?
toggle quoted message
Show quoted text
El dom, 6 feb 2022 a las 19:54, Richard L King (< rlking@...>) escribi¨®: Well, as I said, I really don't understand why you're seeing something different from me. For me, it just works. ? The only thing that does occur to me is that perhaps the condition is actually being accepted and the error occurs when parsing something else in the API message ¨C maybe you have some extraneous field set? ? So can we make sure we're both doing exactly the same thing. ? On the Conditional Orders worksheet, the only fields I set in the first order row are as follows ¨C all other fields are blank: ? Symbol:???????????????????????????? IBM Type:???????????????????????????????? Stock Exchange:???????????????????????? SMART Currency:????????????????????????? USD Action:????????????????????????????? BUY Quantity:????????????????????????? 100 Order Type:????????????????????? MKT Filled:??????????????????????????????? 0 Remaining:??????? ????????????? 0 Avg Fill Price:??????????????????? 0 Last Fill Price:???? ????????????? 0 Parent Id:???????????????????????? 0 Conditions:????????????????????? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? Then I make sure the first order row (Row 7) is selected, and click 'Place / Modify Order': I find it's necessary to click it twice, as the first click just selects the button ¨C very annoying!). ? The order is then sent to TWS and the Id and Status columns are updated more or less instantly. The order appears in TWS, and depending on whether the condition is satisfied it sits there waiting or is executed. ? ? ? ? Hi Richard, thank you for your explanation. I did not explain myself right. If I leave the decimal point "." on the price then I get the same error 320 and the order is not sent.? If I just leave an integer amount (without decimal part) then the order is processed and sent to TWS. So this is really weird because the only thing that produces the error is the decimal point "." on the price condition -> 1.15 What else should I check? ? El dom., 6 feb. 2022 14:05, Richard L King <rlking@...> escribi¨®: Joan ? When the condition is parsed to extract the price value, it uses the following C# statement: ? Price = double.Parse(value, NumberFormatInfo.InvariantInfo); ? You'll find this at line 46 of PriceCondition.cs. The NumberFormatInfo.InvariantInfo parameter means that local culture is not taken into account, so commas in a number are taken to be thousands separators (and are ignored). Thus 1,15 is simply parsed as 115. ? Note that the API uses the invariant culture everywhere when parsing numbers, because otherwise the API would work differently in different regions. ? So you do need to use a period as the decimal point, not a comma. But if I understand you correctly, you seem to be saying that if you use 1.15 that also gets parsed as 115? I cannot understand that. ? Also what changed that you are no longer getting the error?
|
Re: Help handling disconnects so I dont have to log into TWS every time I need to reconnect
We do exactly what you are trying to do all the time, Kyle. We develop and run TWS API Java clients in Eclipse and never have to restart TWS. We can even change classes while clients are running (within certain limits) and Eclipse applies hot patches to the running tasks. Here a few thoughts:
- No two clients can simultaneously use the same clientId. So if you have a suspended task in IntelliJ that holds an established socket connection with TWS (say a break point was triggered), starting a second client with the same clientId will fail during the connect call.
- It looks like you have clientId 0 hardwired in your code. If your client does not need the special features that come with clientId 0, a better approach would be to use a somewhat random clientId, such as Instant.now().getEpochSecond()
- You can always check which clients are currently connected to TWS by selecting the "DATA" button in the top right corner of the TWS window.
- You need to review the design of your application. It does not make sense that you establish the connection with TWS within your requestMarketData method just to disconnect right after you requested data. Connecting to TWS would generally be one of the first things your application does, while disconnecting would be the last thing just before exiting. Your requestMarketDatashould just do that, request market data.
- TWS API is completely asynchronous and a request will generally not return anything right away. Not even errors. Responses (including error reports) get delivered to you via the documented callbacks and you need to make sure that you implement and handle all error callbacks. It is a good practice to log errors and warnings liberally so that you have a better understanding of what is going wrong when it does.
Hope this points you in the right direction,
´³¨¹°ù²µ±ð²Ô
|
Help handling disconnects so I dont have to log into TWS every time I need to reconnect
Hi, Below is the Java method I use to connect to the TWS API. I am still in the process of building my trading system and so I have the need to run my main method, which calls this requestMarketData, via IntelliJ. Once I confirm whatever my recent change was worked or didnt work, I then stop the main method. Ideally, while I am already logged into TWS, I would simply just run my main method again to connect to the API and test another change. Instead, I need to close TWS, reopen it, login, then run my code. Is there a way to handle this??
public void requestMarketData(String ticker) { Contract contract = contract(ticker); int tickId = 1;
client.eConnect(BROKER_CONNECTION_IP, BROKER_CONNECTION_PORT, 0); client.reqMarketDataType(MARKET_DATA_TYPE); client.reqMktData(tickId, contract, TICK_STRING, false /* Snapshot */, false /* Regulatory Snapshot */, null /* MktDataOptions */);
reader = new EReader(client, signal); reader.start(); new Thread(() -> { while (client.isConnected()) { signal.waitForSignal(); try { reader.processMsgs(); } catch (Exception e) { System.out.println("Exception: " + e.getMessage()); } } }).start();
if (!isConnected) return;
client.eDisconnect(); }
|
Re: Any way around the crypto confirmation pop-up?
Maybe because crypto didn't exist when all the experienced people did their development?
toggle quoted message
Show quoted text
On 2/6/2022 1:22 PM, Michael Sutton wrote: I'm surprised?that there aren't a bunch of people already trading crypto with IB API that have worked through this issue already!
|
Re: Conditions on twsactivex api
Well, as I said, I really don't understand why you're seeing something different from me. For me, it just works. ? The only thing that does occur to me is that perhaps the condition is actually being accepted and the error occurs when parsing something else in the API message ¨C maybe you have some extraneous field set? ? So can we make sure we're both doing exactly the same thing. ? On the Conditional Orders worksheet, the only fields I set in the first order row are as follows ¨C all other fields are blank: ? Symbol:???????????????????????????? IBM Type:???????????????????????????????? Stock Exchange:???????????????????????? SMART Currency:????????????????????????? USD Action:????????????????????????????? BUY Quantity:????????????????????????? 100 Order Type:????????????????????? MKT Filled:??????????????????????????????? 0 Remaining:??????? ????????????? 0 Avg Fill Price:??????????????????? 0 Last Fill Price:???? ????????????? 0 Parent Id:???????????????????????? 0 Conditions:????????????????????? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? Then I make sure the first order row (Row 7) is selected, and click 'Place / Modify Order': I find it's necessary to click it twice, as the first click just selects the button ¨C very annoying!). ? The order is then sent to TWS and the Id and Status columns are updated more or less instantly. The order appears in TWS, and depending on whether the condition is satisfied it sits there waiting or is executed. ? ? ?
toggle quoted message
Show quoted text
From: [email protected] <[email protected]> On Behalf Of joanmarcel119 Sent: 06 February 2022 15:18 To: [email protected] Subject: Re: [TWS API] Conditions on twsactivex api? Hi Richard, thank you for your explanation. I did not explain myself right. If I leave the decimal point "." on the price then I get the same error 320 and the order is not sent.? If I just leave an integer amount (without decimal part) then the order is processed and sent to TWS. So this is really weird because the only thing that produces the error is the decimal point "." on the price condition -> 1.15 What else should I check? ? El dom., 6 feb. 2022 14:05, Richard L King <rlking@...> escribi¨®: Joan ? When the condition is parsed to extract the price value, it uses the following C# statement: ? Price = double.Parse(value, NumberFormatInfo.InvariantInfo); ? You'll find this at line 46 of PriceCondition.cs. The NumberFormatInfo.InvariantInfo parameter means that local culture is not taken into account, so commas in a number are taken to be thousands separators (and are ignored). Thus 1,15 is simply parsed as 115. ? Note that the API uses the invariant culture everywhere when parsing numbers, because otherwise the API would work differently in different regions. ? So you do need to use a period as the decimal point, not a comma. But if I understand you correctly, you seem to be saying that if you use 1.15 that also gets parsed as 115? I cannot understand that. ? Also what changed that you are no longer getting the error?
|
Re: Any way around the crypto confirmation pop-up?
Thanks Mike. I must have missed that one. I'm surprised also!
toggle quoted message
Show quoted text
I posted a few days ago with the exact same problem.? Seems really strange.
I submitted a question to IB and they said they are able to repro it and are escalating it.? That's all I know for now.
I'm surprised?that there aren't a bunch of people already trading crypto with IB API that have worked through this issue already!
Mike
I'm doing some development and figured I'd use crypto since it's open outside of regular trading hours, but every time an order is placed, the pop-up on TWS happens, even when I check "don't show again" and all warnings for API are disabled in TWS. It's in a paper trading account, not that it should matter though I'd think. Any ideas?
-Rob
|
Re: Any way around the crypto confirmation pop-up?
I posted a few days ago with the exact same problem.? Seems really strange.
I submitted a question to IB and they said they are able to repro it and are escalating it.? That's all I know for now.
I'm surprised?that there aren't a bunch of people already trading crypto with IB API that have worked through this issue already!
Mike
toggle quoted message
Show quoted text
I'm doing some development and figured I'd use crypto since it's open outside of regular trading hours, but every time an order is placed, the pop-up on TWS happens, even when I check "don't show again" and all warnings for API are disabled in TWS. It's in a paper trading account, not that it should matter though I'd think. Any ideas?
-Rob
|
Any way around the crypto confirmation pop-up?
I'm doing some development and figured I'd use crypto since it's open outside of regular trading hours, but every time an order is placed, the pop-up on TWS happens, even when I check "don't show again" and all warnings for API are disabled in TWS. It's in a paper trading account, not that it should matter though I'd think. Any ideas?
-Rob
|
Re: Conditions on twsactivex api
Hi Richard, thank you for your explanation. I did not explain myself right.
If I leave the decimal point "." on the price then I get the same error 320 and the order is not sent.?
If I just leave an integer amount (without decimal part) then the order is processed and sent to TWS.
So this is really weird because the only thing that produces the error is the decimal point "." on the price condition -> 1.15
What else should I check?
Thank you
toggle quoted message
Show quoted text
El dom., 6 feb. 2022 14:05, Richard L King < rlking@...> escribi¨®: Joan ? When the condition is parsed to extract the price value, it uses the following C# statement: ? Price = double.Parse(value, NumberFormatInfo.InvariantInfo); ? You'll find this at line 46 of PriceCondition.cs. The NumberFormatInfo.InvariantInfo parameter means that local culture is not taken into account, so commas in a number are taken to be thousands separators (and are ignored). Thus 1,15 is simply parsed as 115. ? Note that the API uses the invariant culture everywhere when parsing numbers, because otherwise the API would work differently in different regions. ? So you do need to use a period as the decimal point, not a comma. But if I understand you correctly, you seem to be saying that if you use 1.15 that also gets parsed as 115? I cannot understand that. ? Also what changed that you are no longer getting the error?
|
Re: Conditions on twsactivex api
Joan ? When the condition is parsed to extract the price value, it uses the following C# statement: ? Price = double.Parse(value, NumberFormatInfo.InvariantInfo); ? You'll find this at line 46 of PriceCondition.cs. The NumberFormatInfo.InvariantInfo parameter means that local culture is not taken into account, so commas in a number are taken to be thousands separators (and are ignored). Thus 1,15 is simply parsed as 115. ? Note that the API uses the invariant culture everywhere when parsing numbers, because otherwise the API would work differently in different regions. ? So you do need to use a period as the decimal point, not a comma. But if I understand you correctly, you seem to be saying that if you use 1.15 that also gets parsed as 115? I cannot understand that. ? Also what changed that you are no longer getting the error?
|
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
Thanks for the detailed info! Since my need of data is just price and volume and seconds-delay is acceptable, so IBKR might be enough. But for tick-level prices and other metrics, yes, I can see a dedicated data source has its place.
Yet when I get to run a trading bot with sizable fund, I might also take two data sources (IBKR + another) to alert when discrepancy happens.
Thank you again!
toggle quoted message
Show quoted text
Rob clearly has data needs that require a dedicated data service provider, which IBKR is not. They are a brokerage.
But the IBKR data features are adequate for many (maybe even most) users, especially if your strategy focuses on a set of known instruments. We monitor the IBKR real-time data feeds for about 80 instruments of all types. Among them a few very active futures
where we receive high resolution tick-by-tick data as well as level II ask/bid order book details. This results in 40 million to 60 million individual data items per day and peaks of 1,500 trades per second.
But as Rob said, IBKR data (especially historical data request) cannot support strategies that need very broad data sets, say the OHLCV for all US stocks, for example, or details for all members of the S&P 500. That is where you will need a dedicated and specialized
data service provider. Take a look at the , , and documentation specifically the discussions about request pacing and limits. Chances are that you find what you need.
´³¨¹°ù²µ±ð²Ô
On Fri, Feb 4, 2022 at 11:11 PM, PurpleIce wrote:
Thanks for the info. May you please share what headaches you had in using IBKR's data? Just to be curious, as I also need a data source.
?
|
Re: Conditions on twsactivex api
I was looking more into this issue and found out that the TWSLib class OperatorCondition converts this comma decimal to an integer on this line: ? ? ? ? ? ? ? ? Value = cond.Substring(3);? //This line sets Value with "115" instead of "1,15"
I tried to set it directly by doing: ? ? ? ? ? ? ? ? Value = "1,15"; //but it still converts to a string of "115"
Looking for the set method just found: ? ? ? ? protected abstract string Value { get; set; }
and I don't know how can I continue testing/updating the code?to set the property Value containing a string with a comma
Any ideas on this, please?
Thank you
toggle quoted message
Show quoted text
El dom, 6 feb 2022 a las 0:38, joanmarcel119 via (<joanmarcel= [email protected]>) escribi¨®: I need to clarify that it worked by sending the order attached to a price condition without any error but also.... without decimals, so if I send the condition: last Price of 269459887(GLOBEX) is >= 1.15
it changes in the TWS to 115.000, that's not usable for me yet?
Any clue to solve that problem? Anybody has encountered?a similar issue?
El dom, 6 feb 2022 a las 0:27, joanmarcel119 via (<joanmarcel= [email protected]>) escribi¨®: Hi Richard, first of all thank you very much for having tested this for me, I was today looking for the API data log and found out that you did the tests already. Thank you, I appreciate this.
However I tried again and I reinstalled the TWS API, first 976 then 1012... and nothing, none of the tests that worked for you are working on my side :(? It is really weird because the only tests that worked are the demo one and your first one: last of bid/ask Price of 461318816(GLOBEX) is >= 4460
The other two failed with the same error....?
After writing?these lines above, I checked again the differences between the strings that worked and the ones that did not... and one difference was on the condition price. The lines that worked had no decimal!!! So, could that mean the problem was the decimal point? In Europe we use the comma "," instead of point "." for decimal numbers... long before I changed the Excel application settings on my computer to the USA ones, so I was using the "." for the decimal numbers but I think the IB API knows I'm an European user and it expects comma instead of point
I tried:?last Price of 269459887(GLOBEX) is >= 1,15 and it WORKED!!!!!!!? :)? ??
Thank you Richard again for your help...all merit is yours... if you didn't try different tests I never encountered this issue.?
Have a nice weekend!! Best wishes
El s¨¢b, 5 feb 2022 a las 0:54, Richard L King (< rlking@...>) escribi¨®: Joan ? Well, I did find time for this today after all (change of priorities). And I have to say, I was unable to reproduce your issue. ? I started by amending the demo program I mentioned earlier, to allow a condition to be specified for an order. This then used to set the Conditions property of the Order object in exactly the same way as the VBA in the Excel workbook, using the ParseConditions method of the TWS object. ? Because I don't have a market data subscription for the CT futures, I tried it first buying 100 IBM shares with the following condition, where 461318816 is the conid for ESH2: ? last of bid/ask Price of 461318816(GLOBEX) is >= 4460 ? and it worked perfectly. ? I then tried it using your CT2, like this: ? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? and it still worked! This seems to imply that you can use a contract in a condition for which you don't have market data, which is potentially very useful. (Mind you, the order just sat there waiting for the condition to be satisfied, but it wasn't rejected, so perhaps it would have remained waiting forever.) ? Next I tried it with the condition that gave you the error: ? last Price of 269459887(GLOBEX) is >= 1.15 ? and the order was accepted without problems. ? So clearly the order condition mechanism works fine when the ActiveX API is invoked from C#. So next I tried the same things with the sample Excel workbook, and they all worked fine there too. And I did all this with both API 976 and API 1012. ? I'm satisfied that there isn't actually a bug here, so the question is what caused your failure? Since I can't reproduce the problem, there's really not much more I can do. ? But I suggest you uninstall the API, then install the 9.76 version and start again, just in case something has got mixed up somehow. ? By the way, I notice that the order message information I was looking for from the API log isn't there at all, which seems completely bizarre to me. I always thought all API messages (except market data) were included in the log by default. Perhaps IB thought this is personal information so it shouldn't be in the log, but that seems daft to me, especially as the justification for encrypting the log files ¨C which is also daft ¨C was that they contain potentially personal information. ? Richard
|
Re: Conditions on twsactivex api
I need to clarify that it worked by sending the order attached to a price condition without any error but also.... without decimals, so if I send the condition: last Price of 269459887(GLOBEX) is >= 1.15
it changes in the TWS to 115.000, that's not usable for me yet?
Any clue to solve that problem? Anybody has encountered?a similar issue?
toggle quoted message
Show quoted text
El dom, 6 feb 2022 a las 0:27, joanmarcel119 via (<joanmarcel= [email protected]>) escribi¨®: Hi Richard, first of all thank you very much for having tested this for me, I was today looking for the API data log and found out that you did the tests already. Thank you, I appreciate this.
However I tried again and I reinstalled the TWS API, first 976 then 1012... and nothing, none of the tests that worked for you are working on my side :(? It is really weird because the only tests that worked are the demo one and your first one: last of bid/ask Price of 461318816(GLOBEX) is >= 4460
The other two failed with the same error....?
After writing?these lines above, I checked again the differences between the strings that worked and the ones that did not... and one difference was on the condition price. The lines that worked had no decimal!!! So, could that mean the problem was the decimal point? In Europe we use the comma "," instead of point "." for decimal numbers... long before I changed the Excel application settings on my computer to the USA ones, so I was using the "." for the decimal numbers but I think the IB API knows I'm an European user and it expects comma instead of point
I tried:?last Price of 269459887(GLOBEX) is >= 1,15 and it WORKED!!!!!!!? :)? ??
Thank you Richard again for your help...all merit is yours... if you didn't try different tests I never encountered this issue.?
Have a nice weekend!! Best wishes
El s¨¢b, 5 feb 2022 a las 0:54, Richard L King (< rlking@...>) escribi¨®: Joan ? Well, I did find time for this today after all (change of priorities). And I have to say, I was unable to reproduce your issue. ? I started by amending the demo program I mentioned earlier, to allow a condition to be specified for an order. This then used to set the Conditions property of the Order object in exactly the same way as the VBA in the Excel workbook, using the ParseConditions method of the TWS object. ? Because I don't have a market data subscription for the CT futures, I tried it first buying 100 IBM shares with the following condition, where 461318816 is the conid for ESH2: ? last of bid/ask Price of 461318816(GLOBEX) is >= 4460 ? and it worked perfectly. ? I then tried it using your CT2, like this: ? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? and it still worked! This seems to imply that you can use a contract in a condition for which you don't have market data, which is potentially very useful. (Mind you, the order just sat there waiting for the condition to be satisfied, but it wasn't rejected, so perhaps it would have remained waiting forever.) ? Next I tried it with the condition that gave you the error: ? last Price of 269459887(GLOBEX) is >= 1.15 ? and the order was accepted without problems. ? So clearly the order condition mechanism works fine when the ActiveX API is invoked from C#. So next I tried the same things with the sample Excel workbook, and they all worked fine there too. And I did all this with both API 976 and API 1012. ? I'm satisfied that there isn't actually a bug here, so the question is what caused your failure? Since I can't reproduce the problem, there's really not much more I can do. ? But I suggest you uninstall the API, then install the 9.76 version and start again, just in case something has got mixed up somehow. ? By the way, I notice that the order message information I was looking for from the API log isn't there at all, which seems completely bizarre to me. I always thought all API messages (except market data) were included in the log by default. Perhaps IB thought this is personal information so it shouldn't be in the log, but that seems daft to me, especially as the justification for encrypting the log files ¨C which is also daft ¨C was that they contain potentially personal information. ? Richard
|
Re: Conditions on twsactivex api
Hi Richard, first of all thank you very much for having tested this for me, I was today looking for the API data log and found out that you did the tests already. Thank you, I appreciate this.
However I tried again and I reinstalled the TWS API, first 976 then 1012... and nothing, none of the tests that worked for you are working on my side :(? It is really weird because the only tests that worked are the demo one and your first one: last of bid/ask Price of 461318816(GLOBEX) is >= 4460
The other two failed with the same error....?
After writing?these lines above, I checked again the differences between the strings that worked and the ones that did not... and one difference was on the condition price. The lines that worked had no decimal!!! So, could that mean the problem was the decimal point? In Europe we use the comma "," instead of point "." for decimal numbers... long before I changed the Excel application settings on my computer to the USA ones, so I was using the "." for the decimal numbers but I think the IB API knows I'm an European user and it expects comma instead of point
I tried:?last Price of 269459887(GLOBEX) is >= 1,15 and it WORKED!!!!!!!? :)? ??
Thank you Richard again for your help...all merit is yours... if you didn't try different tests I never encountered this issue.?
Have a nice weekend!! Best wishes
toggle quoted message
Show quoted text
El s¨¢b, 5 feb 2022 a las 0:54, Richard L King (< rlking@...>) escribi¨®: Joan ? Well, I did find time for this today after all (change of priorities). And I have to say, I was unable to reproduce your issue. ? I started by amending the demo program I mentioned earlier, to allow a condition to be specified for an order. This then used to set the Conditions property of the Order object in exactly the same way as the VBA in the Excel workbook, using the ParseConditions method of the TWS object. ? Because I don't have a market data subscription for the CT futures, I tried it first buying 100 IBM shares with the following condition, where 461318816 is the conid for ESH2: ? last of bid/ask Price of 461318816(GLOBEX) is >= 4460 ? and it worked perfectly. ? I then tried it using your CT2, like this: ? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111 ? and it still worked! This seems to imply that you can use a contract in a condition for which you don't have market data, which is potentially very useful. (Mind you, the order just sat there waiting for the condition to be satisfied, but it wasn't rejected, so perhaps it would have remained waiting forever.) ? Next I tried it with the condition that gave you the error: ? last Price of 269459887(GLOBEX) is >= 1.15 ? and the order was accepted without problems. ? So clearly the order condition mechanism works fine when the ActiveX API is invoked from C#. So next I tried the same things with the sample Excel workbook, and they all worked fine there too. And I did all this with both API 976 and API 1012. ? I'm satisfied that there isn't actually a bug here, so the question is what caused your failure? Since I can't reproduce the problem, there's really not much more I can do. ? But I suggest you uninstall the API, then install the 9.76 version and start again, just in case something has got mixed up somehow. ? By the way, I notice that the order message information I was looking for from the API log isn't there at all, which seems completely bizarre to me. I always thought all API messages (except market data) were included in the log by default. Perhaps IB thought this is personal information so it shouldn't be in the log, but that seems daft to me, especially as the justification for encrypting the log files ¨C which is also daft ¨C was that they contain potentially personal information. ? Richard
|
Using TWS with headless IB Gateway
Is it possible to configure TWS to use a headless IB Gateway? My trading program launches the IB gateway and I'd like to still use the TWS application to view my orders/trades, but TWS launches it's own gateway instance and steps on the same user session.
|
Re: TWS Gateway disconnects client periodically
As it turns out, my program did not stop reading the messages, it just didn't read them fast enough. After a period of time, the EBuffer in the TWS Gateway hit ~ 5Mb, then disconnected my client program.? I've made several performance improvements in my code and things are working well now, thanks.
|
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
Rob clearly has data needs that require a dedicated data service provider, which IBKR is not. They are a brokerage.
But the IBKR data features are adequate for many (maybe even most) users, especially if your strategy focuses on a set of known instruments. We monitor the IBKR real-time data feeds for about 80 instruments of all types. Among them a few very active futures where we receive high resolution tick-by-tick data as well as level II ask/bid order book details. This results in 40 million to 60 million individual data items per day and peaks of 1,500 trades per second.
But as Rob said, IBKR data (especially historical data request) cannot support strategies that need very broad data sets, say the OHLCV for all US stocks, for example, or details for all members of the S&P 500. That is where you will need a dedicated and specialized data service provider. Take a look at the , , and documentation specifically the discussions about request pacing and limits. Chances are that you find what you need.
´³¨¹°ù²µ±ð²Ô
toggle quoted message
Show quoted text
On Fri, Feb 4, 2022 at 11:11 PM, PurpleIce wrote:
Thanks for the info. May you please share what headaches you had in using IBKR's data? Just to be curious, as I also need a data source.
?
|