Hello
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
Martin
Excel cell to display live market data
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: Excel cell to display live market data
Hi,
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:
https://trade-commander.com/public-downloads/
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:
https://trade-commander.com/public-downloads/