¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: TWS app keeps exiting on my desktop

 

You might have a JVM log file with more information in case the JVM fails or gives up on TWS for some reason. The file is called? hs_err_pidXXXXX.log with XXXX elaced with the JVM process ID. You will find that file in the "current working directory" where the JVM was running. In many cases that is the Jts installation root folder. But it could be in one of your local folders if you start TWS in a different folder.

You might have quite a lot of those files if your TWS exists frequently.

JR


On Thu, Mar 18, 2021 at 10:44 AM, Stuart Cracraft wrote:
Nothing in the logs.

Not doing anything except letting it run.

I suspect general memory starvation on the instance and will increase its capacity (memory + compute + network) for a tech refresh.

On Mar 18, 2021, at 8:37 AM, mark collins <mark.collins@...> wrote:

Check the logs for errors, because that's not normal behaviour. If there's no errors it could be getting terminated by the os if it's taking a lot of resources, but almost certainly it's something you're doing and not noticing.

Best wishes,

M

On Thu, 18 Mar 2021, 14:27 Stuart Cracraft via groups.io, <smcracraft@...> wrote:
I login, go away, come back and it¡¯s exited.

How do I make it not exit.

All that happens every 30-60 minutes¡­

Bizarre.







Re: TWS app keeps exiting on my desktop

Stuart Cracraft
 

¿ªÔÆÌåÓý

Put it in containers to reduce the number of apps contending for resources.?

Better.?

On Mar 18, 2021, at 8:56 AM, mark collins <mark.collins@...> wrote:

?
It might be that simple, I run mine on virtual machines with a couple of gb ram each and one or two virtual cpus, I do have to raise this if I'm doing a lot with them though. Monitor the resource loads and see whether it is indeed just that.

Best wishes,

M

On Thu, 18 Mar 2021 at 15:44, Stuart Cracraft via <smcracraft=[email protected]> wrote:
Nothing in the logs.

Not doing anything except letting it run.

I suspect general memory starvation on the instance and will increase its capacity (memory + compute + network) for a tech refresh.

> On Mar 18, 2021, at 8:37 AM, mark collins <mark.collins@...> wrote:
>
> Check the logs for errors, because that's not normal behaviour. If there's no errors it could be getting terminated by the os if it's taking a lot of resources, but almost certainly it's something you're doing and not noticing.
>
> Best wishes,
>
> M
>
> On Thu, 18 Mar 2021, 14:27 Stuart Cracraft via , <smcracraft=[email protected]> wrote:
> I login, go away, come back and it¡¯s exited.
>
> How do I make it not exit.
>
> All that happens every 30-60 minutes¡­
>
> Bizarre.
>
>
>
>
>
>
>








--
+44 (0) 7528 551604?
Gulfstream Software - Winner Risk Management Awards 2010
This message is subject to :


Re: TWS app keeps exiting on my desktop

 

It might be that simple, I run mine on virtual machines with a couple of gb ram each and one or two virtual cpus, I do have to raise this if I'm doing a lot with them though. Monitor the resource loads and see whether it is indeed just that.

Best wishes,

M


On Thu, 18 Mar 2021 at 15:44, Stuart Cracraft via <smcracraft=[email protected]> wrote:
Nothing in the logs.

Not doing anything except letting it run.

I suspect general memory starvation on the instance and will increase its capacity (memory + compute + network) for a tech refresh.

> On Mar 18, 2021, at 8:37 AM, mark collins <mark.collins@...> wrote:
>
> Check the logs for errors, because that's not normal behaviour. If there's no errors it could be getting terminated by the os if it's taking a lot of resources, but almost certainly it's something you're doing and not noticing.
>
> Best wishes,
>
> M
>
> On Thu, 18 Mar 2021, 14:27 Stuart Cracraft via , <smcracraft=[email protected]> wrote:
> I login, go away, come back and it¡¯s exited.
>
> How do I make it not exit.
>
> All that happens every 30-60 minutes¡­
>
> Bizarre.
>
>
>
>
>
>
>








--
+44 (0) 7528 551604?
Gulfstream Software - Winner Risk Management Awards 2010
This message is subject to :


Re: TWS app keeps exiting on my desktop

Stuart Cracraft
 

Nothing in the logs.

Not doing anything except letting it run.

I suspect general memory starvation on the instance and will increase its capacity (memory + compute + network) for a tech refresh.

On Mar 18, 2021, at 8:37 AM, mark collins <mark.collins@...> wrote:

Check the logs for errors, because that's not normal behaviour. If there's no errors it could be getting terminated by the os if it's taking a lot of resources, but almost certainly it's something you're doing and not noticing.

Best wishes,

M

On Thu, 18 Mar 2021, 14:27 Stuart Cracraft via groups.io, <smcracraft@...> wrote:
I login, go away, come back and it¡¯s exited.

How do I make it not exit.

All that happens every 30-60 minutes¡­

Bizarre.







Re: TWS app keeps exiting on my desktop

 

Check the logs for errors, because that's not normal behaviour. If there's no errors it could be getting terminated by the os if it's taking a lot of resources, but almost certainly it's something you're doing and not noticing.

Best wishes,

M

On Thu, 18 Mar 2021, 14:27 Stuart Cracraft via , <smcracraft=[email protected]> wrote:
I login, go away, come back and it¡¯s exited.

How do I make it not exit.

All that happens every 30-60 minutes¡­

Bizarre.







TWS app keeps exiting on my desktop

Stuart Cracraft
 

I login, go away, come back and it¡¯s exited.

How do I make it not exit.

All that happens every 30-60 minutes¡­

Bizarre.


Re: Little tool for option chain contract creation

juxeiier
 

New version 0.5 is available, with new lookup functions and bugfixes.
Check new README at https://github.com/juxeii/ibtools


Re: How to get all VALID options

juxeiier
 

Hi Michael,

you might wanna try this little tool I have written, see /g/twsapi/topic/little_tool_for_option_chain/81408600?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,81408600
It basically frees you from doing all of this and provides a fast caching mechanism if? you reload your application.

Cheers,
Juergen


Re: Help getting realtime data stream via TWS API for TICK-NYSE and TRIN-NYSE

 

Go into TWS and right click on any instrument (TRIN or TICK) and select Financial Instrument Info -> Description.? The correct information to put into the Contract object will be specified on the left side of the window that pops up.? In the case of TICK you get:

Underlying = TICK-AMEX
Security Type = IND
Currency = USD
Exchange = AMEX
Symbol = TICK-AMEX

That's what you set for TICK-AMEX.

Hunter

On Thursday, March 18, 2021, 2:20:03 AM PDT, Ullas Diwakar <ullasdiwakar96@...> wrote:


Hi,

I want to get the data stream for the index TICK and TRIN. I read around the group and saw that i need to create the contract with the name TICK-NYSE and TRIN-NYSE with secType as "IND".

After that, I tried to subscribe to realtime data using both reqMktData and?reqRealTimeBars but I am not getting any ticks for it.

I want to know how to get the real time data stream for these two indices.?

Thanks


Help getting realtime data stream via TWS API for TICK-NYSE and TRIN-NYSE

 

Hi,

I want to get the data stream for the index TICK and TRIN. I read around the group and saw that i need to create the contract with the name TICK-NYSE and TRIN-NYSE with secType as "IND".

After that, I tried to subscribe to realtime data using both reqMktData and?reqRealTimeBars but I am not getting any ticks for it.

I want to know how to get the real time data stream for these two indices.?

Thanks


Re: How to get all VALID options

 

Filtering on SMART when dealing with US stocks is OK, but when you deal with foreign or commodities exchanges (MONEP, GLOBEX, NYMEX...), SMART doesn't work anymore.
This is my algo, compliant with any symbol any exchange:
I collect all answers from reqSecDefOptParams.
If SMART is present in the answers, I only keep SMART.
If SMART is NOT present, I keep all answers.


Re: event when a stock reaches a certain price

 

50 messages per second do not apply to this. However, there is some other limit, based on available market data lines.
But polling snapshots have another problem (at least it had a couple of years ago) - snapshot could be cached if polled too frequently. So instead of new prices, you are getting something stale.



On Thu, Mar 18, 2021 at 3:16 AM <sudhin_deshpande@...> wrote:
Instead of subscribing, why not poll each ticker to get the last price?
I think IB has a limit of 50 messages per second (correct me if I am wrong)
For 800 tickers, that would be 16 seconds. So you would poll each ticker about every 16 seconds.
Would that work for you?



--
Best regards,
Chernikov Aleksandr,
e-mail:?me@...
skype:?
RU:?+7-904-179-49-78


Re: Little tool for option chain contract creation

juxeiier
 

Thx Hartmut,

that is a good source to enhance the one I am working on.
I already have something working, which returns a pandas dataframe to do further analysis on the option data.

Cheers
Juergen


Re: Little tool for option chain contract creation

 

Hi,

ib-ruby () has the ability to work on atm, itm and otm-option-chains.

documentation


implementation


Perhaps its worth to take a look, to complete your program


Re: event when a stock reaches a certain price

 

You might have just solved that riddle for me, Bruce, why sometimes only four of the five TickByTick subscriptions succeed. I don't always subscribe to Level II data, so that seems to free up extra TickByTicks.

I tried to stay with IB terminology, so when I referred to market data for the ~75 contracts it means data streams from reqTopMktData() requests. No TickByTick or Level II data. But we determine all valid tick ids for each equity type (STK, FUT, IND, ..) and request everything they are willing to give. So while there is no TickByTick or Level II for those 75, the amount of data is quite substantial.

A long time ago we switched to mostly immutable objects, flow processing, and a logging strategy that favors logging complete objects over human readable text. That way we can drill down after the fact and are not limited to deciphering incomplete information in the log messages. Objects are being serialized into Json strings and saved with some rich extra context. Log files are being rolled every 15min and compressed with "gzip --best" n the background at low system priorities. That all is handled asynchronously in a couple threads and does not slow down IB API callback processing even under the heaviest of loads.

I just grabbed a random day that had 35 million IB callbacks:
  • With all the extra context and object serialization overhead, the average uncompressed object is 224 bytes long for a total of just shy of 8GB
  • But Json serialized objects compress very nicely so that that we store less than 12 bytes per object in average after compression or just over 400MB
This may sound like a lot of unnecessary overhead and long delays but it actually is not. Data stream serialization/compression and decompression/deserialization happen on the fly and it is quite liberating that you can insert any object type into the streams and get high-level language objects back into your business logic (without any extra work).

Processing can takes place in parallel on multi-processors and most systems have ample idle and otherwise unused CPU power for this.

´³¨¹°ù²µ±ð²Ô


On Wed, Mar 17, 2021 at 08:22 PM, Bruce B wrote:
JR,
?
You must have 8 market depth level 2 subscriptions.
?
I seem to have 6 subscriptions and can pull 6 full book depth level 2 but if I use?TickByTickBidAsk?that also counts towards marketdepthlevel2. Do you see the same?
?
By "That is *all available market data for ~75 contracts" I think you mean partial data as you do not get market depth level 2 for all 75.
?
What you mean by "I ask for five and most of the days I get five"? Some days you intentionally dont ask for five or something is not available on some days or not worth pulling based on your strategies?
?
Sounds like you have a good system running. I am interested to know how you store all this streaming data or if you do not see a point in storing it?
?
- Bruce


On Wed, Mar 17, 2021, 7:11 PM JR <TwsApiOnGroupsIo@...> wrote:
Can you be more specific what you consider huge? Did you buy quote boosters so that you can subscribe to more than 100 contracts?

From what you are doing, I'd say you'd only need to subscribe to monitor the Last Price and Last Size ticks. So you would look at roughly 4 - 5 call backs per contract per second.

You might want to review your approach and code. I am subscribing to a pretty massive amount of data (process and log them in a Json format) and my server does not break a sweat. And it's a very small server for today's standards. Just to give you some idea:
  • The total volume is between 30million and 60million ticks per day and sometimes more than 1,000 callbacks per second for busy days
  • That is all available market data for ~75 contracts
  • Plus TickByTickLast and TickByTickBidAsk for five contracts (yes five. I ask for five and most of the days get five)
  • Plus Level II for three contracts
We use the standard Java API..

´³¨¹°ù²µ±ð²Ô
On Wed, Mar 17, 2021 at 03:54 PM, corneliu maftuleac wrote:
Hi,

I am trying to monitor a list of tickers (lets say the list is big).
I want to know when one of the tickers reaches a certain price. The target price is generated by an algo so it's not just a %-change.

I tried subscribing to realtime data to all of the instruments but this generates HUGE amount of network traffic to the point that my code is not really able to process all of the events.
Is this possible to do with scanner subscriptions?
I dont find where I can specify that scanner subscriptions to work only with a specific ticker or a list of tickers.

?

?


Re: event when a stock reaches a certain price

 

Instead of subscribing, why not poll each ticker to get the last price?
I think IB has a limit of 50 messages per second (correct me if I am wrong)
For 800 tickers, that would be 16 seconds. So you would poll each ticker about every 16 seconds.
Would that work for you?


Re: event when a stock reaches a certain price

corneliu maftuleac
 

Thank you for the reference, that is good info to know.


Re: event when a stock reaches a certain price

corneliu maftuleac
 

> So each of your ticker has its own trigger price
That is correct, each ticker has its own trigger price. Criteria is not generic and is absolute (not in %).


Re: event when a stock reaches a certain price

 

So each of your ticker has its own trigger price or your trigger criteria is generic?


Re: event when a stock reaches a certain price

 

JR,

You must have 8 market depth level 2 subscriptions.

I seem to have 6 subscriptions and can pull 6 full book depth level 2 but if I use?TickByTickBidAsk?that also counts towards marketdepthlevel2. Do you see the same?

By "That is *all available market data for ~75 contracts" I think you mean partial data as you do not get market depth level 2 for all 75.

What you mean by "I ask for five and most of the days I get five"? Some days you intentionally dont ask for five or something is not available on some days or not worth pulling based on your strategies?

Sounds like you have a good system running. I am interested to know how you store all this streaming data or if you do not see a point in storing it?

- Bruce


On Wed, Mar 17, 2021, 7:11 PM JR <TwsApiOnGroupsIo@...> wrote:
Can you be more specific what you consider huge? Did you buy quote boosters so that you can subscribe to more than 100 contracts?

From what you are doing, I'd say you'd only need to subscribe to monitor the Last Price and Last Size ticks. So you would look at roughly 4 - 5 call backs per contract per second.

You might want to review your approach and code. I am subscribing to a pretty massive amount of data (process and log them in a Json format) and my server does not break a sweat. And it's a very small server for today's standards. Just to give you some idea:
  • The total volume is between 30million and 60million ticks per day and sometimes more than 1,000 callbacks per second for busy days
  • That is all available market data for ~75 contracts
  • Plus TickByTickLast and TickByTickBidAsk for five contracts (yes five. I ask for five and most of the days get five)
  • Plus Level II for three contracts
We use the standard Java API..

´³¨¹°ù²µ±ð²Ô
On Wed, Mar 17, 2021 at 03:54 PM, corneliu maftuleac wrote:
Hi,

I am trying to monitor a list of tickers (lets say the list is big).
I want to know when one of the tickers reaches a certain price. The target price is generated by an algo so it's not just a %-change.

I tried subscribing to realtime data to all of the instruments but this generates HUGE amount of network traffic to the point that my code is not really able to process all of the events.
Is this possible to do with scanner subscriptions?
I dont find where I can specify that scanner subscriptions to work only with a specific ticker or a list of tickers.