Hi,
I'm building a c# api program to create a montage more friendly than TWS's interface. However, as a novice programmer I'm hitting some walls.
The latest one is how to get the position information, namely the size and average cost, for the contract selected in the montage (combobox, or textbox).
I know the IBapi "updateportfolio" and "position" methods returns the data I'm looking for, but I my knowledge only allows me to fetch all contracts (including closed positions) and as strings, instead of returning a value for each data, by the selected contract.
In youtube there is an example of what I want to achieve, but it using an older TWS API version (AxTWSLib._DtwsEvents_updatePortfolioExEvents).
For now, I'm getting the data throw a data grid view, but I believe it can be achieved thru a simple code.
I would appreciate any help on this.
Thanks.
I'm building a c# api program to create a montage more friendly than TWS's interface. However, as a novice programmer I'm hitting some walls.
The latest one is how to get the position information, namely the size and average cost, for the contract selected in the montage (combobox, or textbox).
I know the IBapi "updateportfolio" and "position" methods returns the data I'm looking for, but I my knowledge only allows me to fetch all contracts (including closed positions) and as strings, instead of returning a value for each data, by the selected contract.
In youtube there is an example of what I want to achieve, but it using an older TWS API version (AxTWSLib._DtwsEvents_updatePortfolioExEvents).
For now, I'm getting the data throw a data grid view, but I believe it can be achieved thru a simple code.
I would appreciate any help on this.
Thanks.
Last edited: