官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 扎兰屯市| 桐乡市| 博野县| 津南区| 木里| 历史| 屏边| 贡觉县| 元谋县| 和平县| 阳新县| 谢通门县| 平安县| 隆尧县| 论坛| 新丰县| 肥东县| 商都县| 石屏县| 广州市| 通州区| 古蔺县| 锦州市| 凤庆县| 永康市| 咸阳市| 东至县| 太康县| 吉木萨尔县| 油尖旺区| 鄂托克旗| 甘孜| 尉犁县| 鸡西市| 盱眙县| 克山县| 东光县| 连城县| 桐柏县| 景德镇市| 赣榆县|