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

The total pending buy quantity of a financial instrument

The total pending buy quantity for a financial instrument is the sum total of the quantity of all the pending buy orders available at an instant. This data is dynamic in nature and may change at any moment during the live trading hours.

Getting ready

Make sure the broker_connection and instrument1 objects are available in your Python namespace. Refer to the Technical requirements section of this chapter to set up broker_connection. Refer to the Attributes of a financial instrument recipe of this chapter to set up instrument1.

How to do it…

Fetch and print the total pending buy quantity of instrument1:

>>> total_pending_buy_quantity = \
broker_connection.get_total_pending_buy_quantity(instrument1)
>>> print(f'Total pending BUY quantity: {total_pending_buy_quantity}')

We get the following output (your output may differ):

Total pending BUY quantity: 1319590

How it works…

The get_total_pending_buy_quantity() method of the BrokerConnectionZerodha class fetches the total buy quantity for the given financial instrument at any given moment. This method takes an object of the Instrument type as a parameter. We use instrument1 as the parameter here. 

主站蜘蛛池模板: 丹江口市| 金湖县| 淳安县| 涟源市| 清徐县| 五指山市| 抚宁县| 孙吴县| 即墨市| 富平县| 内丘县| 那坡县| 衡山县| 东平县| 长白| 历史| 苏尼特左旗| 五大连池市| 鹤峰县| 县级市| 昂仁县| 合山市| 连江县| 炎陵县| 应城市| 龙泉市| 鹤岗市| 秀山| 瑞丽市| 黔江区| 瑞安市| 年辖:市辖区| 潜山县| 土默特左旗| 五台县| 高安市| 岳普湖县| 纳雍县| 望奎县| 双桥区| 子长县|