开云体育

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

Re: conditional order conditioned on execution of buy order only?

 

I don't think your idea with two client connections will work. ExecutionCondition decisions are most definitely made within IBKR's infrastructure and not by TWS/IBGW. And at that point, IBKR is only concerned about accounts and orders regardless of how many client connections to TWS/IBGW exist.
?
We don't know all your requirements, but wouldn't a simple order attachment due the trick? You'd attach the order you want to trigger upon execution of the BUY order to the BUY order via parentId. Just like hedge and bracket orders. The child order will not become active until the parent (BUY) executes.
?
闯ü谤驳别苍
?
?
On hu, Jan 9, 2025 at 07:56 AM, Neal Young wrote:

I have a question about conditional orders, where the condition is an execution condition, per
?
?
?
The documentation says that the condition is defined by giving a symbol, an exchange, and a security type, and that the condition is met "whenever a trade occurs on the specified product at the given exchange." Per other discussions here (e.g. 闯ü谤驳别苍's comment) I assume that the trade must be a trade in the current account (one that would trigger an execDetails message).
?
Here's my question:
?
in the case that I have two standing orders for the symbol, namely a buy order and a sell order, is it possible to have the condition trigger only when the buy order executes (and not when the sell order executes)?
?
(I don't see how, although I did think of one possible workaround: have two separate processes, each with its own connection to TWS, one managing the buy order, the other managing the sell order. ?Then (perhaps?) the execution condition set by the process that placed the buy order would only be triggered if the buy order executes. ?I don't know if this would work (I haven't tested it). ?I don't really want to resort to this, as having two separate processes, each with a separate connection to TWS, would complicate my code quite a bit.)
?
Thanks,
?
Neal


Delphi and TWS

 

Hi
?
Is anyone working with Delphi (pascal) to connect to TWS? I can't connect at all.
?
Thanks


conditional order conditioned on execution of buy order only?

 

I have a question about conditional orders, where the condition is an execution condition, per
?
?
?
The documentation says that the condition is defined by giving a symbol, an exchange, and a security type, and that the condition is met "whenever a trade occurs on the specified product at the given exchange." Per other discussions here (e.g. 闯ü谤驳别苍's comment) I assume that the trade must be a trade in the current account (one that would trigger an execDetails message).
?
Here's my question:
?
in the case that I have two standing orders for the symbol, namely a buy order and a sell order, is it possible to have the condition trigger only when the buy order executes (and not when the sell order executes)?
?
(I don't see how, although I did think of one possible workaround: have two separate processes, each with its own connection to TWS, one managing the buy order, the other managing the sell order. ?Then (perhaps?) the execution condition set by the process that placed the buy order would only be triggered if the buy order executes. ?I don't know if this would work (I haven't tested it). ?I don't really want to resort to this, as having two separate processes, each with a separate connection to TWS, would complicate my code quite a bit.)
?
Thanks,
?
Neal


Re: same volume for SMART and NYSE or ISLAND in reqMktData

 

The "Volume" tick does seem to report the same value for @SMART and @NYSE and it includes "Unreportable Trades" since the value is identical to the totalVolume field of the "RtVolume" tick.

But the totalVolume field of the "RtTradeVolume" tick does report exchange specific values similar to reqHistoricalData if that is what you are looking for. Below the last reported Volume, RtVolume, and RtTradeVolume ticks for @SMART and @NYSE from my test.

Also, LastExchange in both feeds properly identifies the source of "Price" ticks so that your client could keep a more detailed picture of the trade distribution across all exchanges the instrument trades on.

闯ü谤驳别苍

?
?
On Thu, Jan 9, 2025 at 05:13 AM, ajn wrote:

Thanks 闯ü谤驳别苍, very serious work! Very appreciated!
I guess the expectation that the difference between calling @SMART would give info from all exchanges yet @NYSE would give info specific for NYSE. And particular indicator which is expected to be very different is volume. Yet both my test and yours shows that it is basically the same number.?
?
Fortunately, in my case I am only interested in full data. So it is not causing any issues for me. However, like it often happens: "If there is discrepancy between expectation and reality it is worth double checking, very likely there is an issue on my side, I understand it wrong or code it wrong or anything else is wrong on my side". So I approach it only from this angle. If consensus on this forum is?
1. reqHistoricalData will give you very different volume data for @SMART vs @NYSE (SMART having ALL the volume, NYSE only for that specific exchange)
2. reqMktData will give you same volume data no matter if you call it for @SMART or @NYSE, we don't know why (or insert explanation here)
?
I am totally fine with that consensus. Just trying to get rid of bugs/discrepancies one by one in my code/understanding of IB API.?
AJ


Re: same volume for SMART and NYSE or ISLAND in reqMktData

 

Good job 闯ü谤驳别苍 and AJ. I learnt this today and wanted to say Thank you to you both.?
This type of analysis is why we are in the forum.?

Daniel.

On Thu, Jan 9, 2025 at 12:13?PM ajn via <andrei.jefremov=[email protected]> wrote:
Thanks 闯ü谤驳别苍, very serious work! Very appreciated!
I guess the expectation that the difference between calling @SMART would give info from all exchanges yet @NYSE would give info specific for NYSE. And particular indicator which is expected to be very different is volume. Yet both my test and yours shows that it is basically the same number.?
?
Fortunately, in my case I am only interested in full data. So it is not causing any issues for me. However, like it often happens: "If there is discrepancy between expectation and reality it is worth double checking, very likely there is an issue on my side, I understand it wrong or code it wrong or anything else is wrong on my side". So I approach it only from this angle. If consensus on this forum is?
1. reqHistoricalData will give you very different volume data for @SMART vs @NYSE (SMART having ALL the volume, NYSE only for that specific exchange)
2. reqMktData will give you same volume data no matter if you call it for @SMART or @NYSE, we don't know why (or insert explanation here)
?
I am totally fine with that consensus. Just trying to get rid of bugs/discrepancies one by one in my code/understanding of IB API.?
AJ



--
Daniel


Re: same volume for SMART and NYSE or ISLAND in reqMktData

 

Thanks 闯ü谤驳别苍, very serious work! Very appreciated!
I guess the expectation that the difference between calling @SMART would give info from all exchanges yet @NYSE would give info specific for NYSE. And particular indicator which is expected to be very different is volume. Yet both my test and yours shows that it is basically the same number.?
?
Fortunately, in my case I am only interested in full data. So it is not causing any issues for me. However, like it often happens: "If there is discrepancy between expectation and reality it is worth double checking, very likely there is an issue on my side, I understand it wrong or code it wrong or anything else is wrong on my side". So I approach it only from this angle. If consensus on this forum is?
1. reqHistoricalData will give you very different volume data for @SMART vs @NYSE (SMART having ALL the volume, NYSE only for that specific exchange)
2. reqMktData will give you same volume data no matter if you call it for @SMART or @NYSE, we don't know why (or insert explanation here)
?
I am totally fine with that consensus. Just trying to get rid of bugs/discrepancies one by one in my code/understanding of IB API.?
AJ


Re: same volume for SMART and NYSE or ISLAND in reqMktData

 

Some more stats from comparing real-time feeds for MTDR@NYSE and MTDR@SMART on 20250108 between 13:30 and 16:10 US/Central:
  • The NYSE feed did not get any 5 second real time bars
  • The SMART feed received more than twice the ticks than the NYSE feed
  • Several ticks (marked in green) received the same number of ticks and the same data. Except for "Volume" where 3 of the 946 ticks had different values
  • Seven tick types were only sent in the SMART feed.
Hope this help,
闯ü谤驳别苍
?


Re: same volume for SMART and NYSE or ISLAND in reqMktData

 

I have never looked into this in the first place, but after a quick test with my data recorder I can confirm your observation for the Volume tick as well as all fields of the RtVolume tick. But the data feeds are not identical and other ticks may provide different values.

My quick test:

  • Requested MTDR@SMART from an IBGW paper account
  • And in parallel MTDR@NYSE from a TWS Paper account
  • Over a 15 min periods, SMART had received 1,611 ticks while NYSE received only received 657
  • My data recorder requests all available tick types when calling reqMktData

I'll let this run for the rest of the day and, if I can find some time, will drill down a little more.

闯ü谤驳别苍

PS. Going forward, please do not attach code to your posts and limit the code inside the posts to the absolute minimum. We are not a Python code exchange, you cannot expect other people to run your code, it makes your posts and the discussion less relevant for the majority of members that use programming languages other than Python, and serious legal and licensing issues can arise.

?
On Wed, Jan 8, 2025 at 12:17 PM, ajn wrote:

?
The question is: is that expected behavior for reqMktData? I was not expecting this, I was expecting same behavior as for reqHistoricalData


same volume for SMART and NYSE or ISLAND in reqMktData

 

In this answer it was pointed out the importance of setting SMART as a contract exchange to get most of the information/volume while using reqMktData. Which I always believed is the correct way, totally agree. However I double checked and found that for reqMktData it doesn't seem to matter. I.e. no matter if I ask for SMART or specific exchange I get the same volume information. Note, this is true only for reqMktData, if I use historical data using reqHistoricalData I see very different volume for SMART vs NYSE/ISLAND just like expected. So not to hijack the original thread maybe we can clear it up here.?
?
If I run the attached program like this >python Program_exchanges.py --port 4001 I get the following output. I.e. looks like I am getting same volume for all exchanges (maybe several lots difference sometimes, I guess it has to do with timing, but definitely not 20-70% volume difference as one would expect having seen historical data).
?
I have tried different stocks. Seems to be true for all I have tried. In case one want to experiment this is how I list the contracts I want data for
?
and then loop through them and ship go reqMktData
?
The question is: is that expected behavior for reqMktData? I was not expecting this, I was expecting same behavior as for reqHistoricalData


Re: 2024 NQ and ES futures historical data

 

Thank you for the tip!


Re: 2024 NQ and ES futures historical data

 

开云体育

I was using databento.com to get historical data for various futures for periods that were not covered by IB. They provide data for various ticks and charge $28/GB. They also use to give some credit when you sign up that may cover some of your expenses.

Thank you,
Michael?

On Jan 7, 2025, at 2:20?PM, IBmark via groups.io <ferreira.helhazar@...> wrote:

?
Hi everyone,
?
I need to test something and I have been having a bit of trouble requesting data from IB. Does anyone have last year?s historical data for ES and NQ? doesn?t have to be tick data. Alternatively where can I find it cheap and reliable??
?
thanks a bunch.?


Re: 2024 NQ and ES futures historical data

 

Thanks anyway!


Re: 2024 NQ and ES futures historical data

 

Hi Dale, unfortunately some data is not coming out well. Incomplete, chunks missing, some days not even work.?


Re: 2024 NQ and ES futures historical data

 

开云体育

Oh ok, I haven't used less than 1 min for historical data.

Mel





-------- Original message --------
From: "IBmark via groups.io" <ferreira.helhazar@...>
Date: 2025-01-07 3:30 p.m. (GMT-08:00)
Subject: Re: [TWS API] 2024 NQ and ES futures historical data

Thank you Mel for your reply! Language is python. I have been using 5/10 second candlestick resolution, higher than that I am afraid it wont test well...


Re: 2024 NQ and ES futures historical data

 

I don’t think we allowed to share data per our contract. ?
Why don’t you just download it from IB?

On Tue, Jan 7, 2025 at 6:30?PM IBmark via <ferreira.helhazar=[email protected]> wrote:
Thank you Mel for your reply! Language is python. I have been using 5/10 second candlestick resolution, higher than that I am afraid it wont test well...


Re: 2024 NQ and ES futures historical data

 

Thank you Mel for your reply! Language is python. I have been using 5/10 second candlestick resolution, higher than that I am afraid it wont test well...


Re: 2024 NQ and ES futures historical data

 

开云体育

What language do you use?? If python I can probably help you fix your request if you just need daily.? Minute data would take a bit...





-------- Original message --------
From: "IBmark via groups.io" <ferreira.helhazar@...>
Date: 2025-01-07 11:20 a.m. (GMT-08:00)
Subject: [TWS API] 2024 NQ and ES futures historical data

Hi everyone,
?
I need to test something and I have been having a bit of trouble requesting data from IB. Does anyone have last year?s historical data for ES and NQ? doesn?t have to be tick data. Alternatively where can I find it cheap and reliable??
?
thanks a bunch.?


2024 NQ and ES futures historical data

 

Hi everyone,
?
I need to test something and I have been having a bit of trouble requesting data from IB. Does anyone have last year?s historical data for ES and NQ? doesn?t have to be tick data. Alternatively where can I find it cheap and reliable??
?
thanks a bunch.?


Hotkey for market data lines?

 

In the recent past I came across a hotkey that provided a detailed list of data lines (window, instrument, and exchange). It was updated dynamically. I link several windows together so clicking on a line in a watchlist changed several windows and the data lines associated with them.
?
This is different that the summary you get with <ctrl><alt>=.
?
I'm sure I wrote it down but that sticky note is probably behind my desk somewhere.
?
I'm using TWS 10.30
?


Re: How to identify futures orders placed by ATS

 

For those who trade futures. IB support told to populate one of the fields below with custom ID that differentiates manual and ATS orders.?
?