Separating Research Languages from Broker API Languages
Summary
The document explains that the programming language used to develop a trading strategy does not have to match the language used to communicate with a broker. It describes a common architecture in which analysis is performed in one language and orders or results are sent through a broker’s HTTP-based REST API, often using JSON. Any language able to follow the API’s specifications can handle that communication, so a workflow might use R for analysis and Python for transmission, or use one language for both.
The replies also mention Interactive Brokers as offering a native Python API and refer to earlier third-party interfaces. These broker-specific details are brief and may change over time; the main reusable point is the separation between research code and execution connectivity. The discussion does not compare brokers, cover authentication or reliability, or explain how to connect Zipline to a particular service, so it serves as an architectural clarification rather than an implementation guide.
Key ideas
- A strategy’s research language does not have to match the language used to send broker requests.
- A REST API can let programs in different languages communicate with a broker through a common interface.
- The broker’s API specification determines how execution requests must be formed.
- Broker-specific API offerings and third-party integrations can change over time.
Tags
Full text
# Choosing broker to run with Zipline # Choosing broker to run with Zipline Which brokers offer Python integration/API? Which brokers offer R integration? I'm starting on trading, and I want to learn about algorithm trading. So I would like to know what brokers offers these languages apis. ## Answer by Unknown Coder (score 2) https://quant.stackexchange.com/a/14620 You're confusing the language that you will use for your analysis with the language you will use to execute your results. The modern approach for APIs (for all industries/apps) is to use and HTTP based REST API that is exposed to the outside world, most likely with something like JSON. This approach works because it can be used by a large variety of languages. So, on the developer/analyst end you can use a variety of languages to handle your REST communications however you choose. How you make your analysis and generate results is of no consequence to the API provider (in this case, the broker). So you could do something like generate results with R and then transmit them with python. Generate all results with python and also transmit them with python. Really, you can do whatever you want on your end as long as you follow the REST specifications given to you by the broker. ## Answer by jersey bean (score 0) https://quant.stackexchange.com/a/35298 Apparently Interactive Brokers (IB) now supports a native Python API. Previously, I recall there at least two 3rd party APIs to IB: - IbPy (https://github.com/blampe/IbPy) - iBridgePy (http://www.ibridgepy.com/)
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.