Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Hoping for some help on individual lot information
Hello!??
I'm a long time reader, first time poster.? I have one contract which I purchase multiple times at multiple prices. So for example: 10 shares AAPL at $100 10 shares AAPL at $200 reqPositions() returns a single Position of 20 shares AAPL with avg price of $150.?? Is there any way to get individual lot information through the API instead of the aggregate? Thank you in advance. --Jonathan |
On Wed, Nov 18, 2020 at 01:03 AM, <jsheena@...> wrote:
Is there any way to get individual lot information through the API instead of the aggregate? Thank you in advance.No, there isn't with IB. For your open positions they only provide the total shares and the total cost of buying these shares. You would have to build and store your own database with the details of each trade. Then you can calculate yourself what you are looking for. |
You can request a list of all today¡¯s executions, and/or set up to receive both order and execution (and commission report) records every time they are created.
Then you can either store them in a database to maintain ¡°state¡± with IB, or just hold them in memory to work out which are part of the current open positions. |
Nick
¿ªÔÆÌåÓýYou can request executions for up to 1 week previous to the
current day. You have to set the Trade Log in TWS to check the
boxes for all days of the week. You might also look into Flex reports. They are not part of the
api but some people have semi-automated the process of running the
reports and scraping desired info from them. On 11/18/2020 4:35 PM,
jsheena@... wrote:
Thank you Nich, and J G |
Nick
¿ªÔÆÌåÓýI think the OrderRef field is available in Flex reports. You can
set that text field to any value you want when you place the
order. On 11/18/2020 8:48 PM,
jsheena@... wrote:
Thanks, Nick. |
to navigate to use esc to dismiss