Accessing Interactive Brokers Positions Through IBridgePy
Summary
The document concerns retrieving current positions through the Interactive Brokers API. The questioner is unsure how to use the position request method because they cannot identify an associated event handler. The answer points to IBridgePy, an open-source Python connection to the broker API, and says positions are available through the framework’s portfolio context as a pandas data frame. This offers an alternative way to access position data within an IBridgePy strategy, rather than explaining the event-driven API call itself.
The response refers to a broker-hosted webinar as background, but provides no code, API event sequence, or demonstration of the position data. Its guidance is therefore limited to users working in Python with IBridgePy; it does not resolve how to request positions using VB.NET or ActiveX directly. The document is a narrow integration tip, not a general treatment of position management or trading strategy.
Key ideas
- The answer suggests using IBridgePy to access positions from an Interactive Brokers account.
- It says IBridgePy exposes positions through a portfolio context as a pandas data frame.
- The response does not explain the VB.NET or ActiveX event handler for the broker API call.
Tags
Full text
# How to request current Interactive Broker positions using VBnet/Activex and the API? # How to request current Interactive Broker positions using VBnet/Activex and the API? I'm trying to use the reqPositions() method but it doesn't have an event handler associated with it that it references in the API. ## Answer by hui (score 1) https://quant.stackexchange.com/a/32087 Interactive Brokers hosted a webinar on Nov. 10 2016 about Implement Algo Trading coded in Python using Interactive Brokers API. The presenter gave a good explanation on the applicability of IBridgePy, which is an open-sourced software used to connect to Interactive Brokers C++ API for execution of python codes in live markets.The webinar is posted at youtube. https://www.youtube.com/watch?v=hogXB07OJ_I. You don't need to call reqPositions() in IBridgePy. The positions are saved at context.portofolio.positions in pandas dataFrame. It is pretty easy to use them in other parts of the code.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.