- Python Algorithmic Trading Cookbook
- Pushpak Dagade
- 134字
- 2021-06-11 18:29:23
Querying a list of exchanges
An exchange is a marketplace where instruments are traded. Exchanges ensure that the trading process is fair and happens in an orderly fashion at all times. Usually, a broker supports multiple exchanges. This recipe demonstrates how to find the list of exchanges supported by the broker.
Getting ready
Make sure the instruments object is available in your Python namespace. Refer to the second recipe of this chapter to learn how to set up this object.
How to do it…
Display the exchanges supported by the broker:
>>> exchanges = instruments.exchange.unique()
>>> print(exchanges)
You will get the following output:
['BCD' 'BSE' 'NSE' 'CDS' 'MCX' 'NFO']
How it works…
instruments.exchange returns a pandas.Series object. Its unique() method returns a numpy.ndarray object consisting of unique exchanges supported by the broker.
推薦閱讀
- Oracle SOA Governance 11g Implementation
- 輕輕松松自動(dòng)化測(cè)試
- SCRATCH與機(jī)器人
- 模型制作
- Lightning Fast Animation in Element 3D
- Salesforce Advanced Administrator Certification Guide
- Apache源代碼全景分析(第1卷):體系結(jié)構(gòu)與核心模塊
- 寒江獨(dú)釣:Windows內(nèi)核安全編程
- Xilinx FPGA高級(jí)設(shè)計(jì)及應(yīng)用
- 網(wǎng)絡(luò)安全原理與應(yīng)用
- Java求職寶典
- Learning Couchbase
- 巧學(xué)活用AutoCAD
- Hands-On Data Analysis with Scala
- 智能機(jī)器人技術(shù):安保、巡邏、處置類警用機(jī)器人研究實(shí)踐