- Python Algorithmic Trading Cookbook
- Pushpak Dagade
- 199字
- 2021-06-11 18:29:25
Fetching the list of financial instruments
Financial instruments, also known as securities, are assets that can be traded in an exchange. In an exchange, there can be tens of thousands of financial instruments. The list of financial instruments is static in nature, as it doesn't change during the live trading hours. Financial instruments may change from time to time, but never within the same day. Having this data handy is the first step for algorithmic trading. This recipe shows how to fetch the list of financial instruments.
Getting ready
Make sure the broker_connection object is available in your Python namespace. Refer to the Technical requirements section of this chapter to set it up.
How to do it…
Fetch and display all the available financial instruments using broker_connection:
>>> instruments = broker_connection.get_all_instruments()
>>> instruments
We get the following output (your output may differ):

How it works…
This recipe fetches all the available financial instruments using the get_all_instruments() method of broker_connection, which returns a pandas.DataFrame object. This object is assigned to a new attribute, instruments, which is displayed in the output. This output may differ for you as new financial instruments are frequently added and existing ones expire regularly.
- 影視后期制作(Avid Media Composer 5.0)
- 數據挖掘實用案例分析
- WordPress Theme Development Beginner's Guide(Third Edition)
- 網絡綜合布線設計與施工技術
- Learning C for Arduino
- Nginx高性能Web服務器詳解
- Machine Learning with Apache Spark Quick Start Guide
- 空間站多臂機器人運動控制研究
- Visual FoxPro程序設計
- 電腦上網輕松入門
- MATLAB-Simulink系統仿真超級學習手冊
- 空間機器人
- JRuby語言實戰技術
- 工業機器人集成應用
- Effective Business Intelligence with QuickSight