Excel cell to display live market data

Discuss, post your questions about TWSLink here.

Users who just registered, please write an email to
with your username mentioned.
So we can distinguish you from bots.
Thank you
Post Reply
Posts: 1
Joined: Mon Sep 04, 2017 1:51 am

Excel cell to display live market data

Post by arjfca » Mon Sep 04, 2017 1:58 am


Very long time that I played with the code. I don't figured yet how to get live bid market price value to be linked to a cell. Value of the cell corresponding to the last price on TWS. I didn't find info on the site on how to proceed

Any info appreciated


Site Admin
Posts: 174
Joined: Mon Apr 24, 2017 3:24 pm

Re: Excel cell to display live market data

Post by board_admin » Tue Sep 12, 2017 12:28 pm

sorry for late answer.
TWSLink in Excel is used within VBA code for the sheet and in general modules.

Typically, you define a callback function in a general module where you receive all TWSLink messages.
This callback serves as a kind of hub and distributes messages to the sheets.
Such a message is e.g. realtime market data which has main category=2. So first int paramter is 2.

(What values else, uid of contract, type of tick, etc. are carried out, is explained in the help page
for this event. You get help by clicking on Start, scroll to TWSLink and select help index in the internet.)

In your sheet you write a handler for realtime tick and you simply assign the bid or ask to the cell value.

Please download the Excel samples from our website:

Post Reply