- Python Algorithmic Trading Cookbook
- Pushpak Dagade
- 149字
- 2021-06-11 18:29:22
Fetching an instrument
Instruments, also known as financial instruments or securities, are assets that can be traded in an exchange. In an exchange, there can easily be tens of thousands of instruments. This recipe demonstrates how to fetch an instrument based on its exchange and trading symbol.
Getting ready
Make sure the broker_connection object is available in your Python namespace. Refer to the first recipe in this chapter to set up this object.
How to do it…
Fetch an instrument for a specific trading symbol and exchange:
>>> broker_connection.get_instrument(segment='NSE', tradingsymbol='TATASTEEL')
You'll get the following output:
segment: NSE
exchange: NSE
tradingsymbol: TATASTEEL
broker_token: 895745
tick_size: 0.05
lot_size: 1
expiry:
strike_price: 0.0
How it works…
The broker_connection object provides a handy method, get_instrument, for fetching any financial instrument. It takes segment and tradingsymbol as attributes before returning an instrument. The return object is an instance of the Instrument class.
- Oracle SOA Governance 11g Implementation
- Visualforce Development Cookbook(Second Edition)
- 網上沖浪
- 樂高機器人EV3設計指南:創造者的搭建邏輯
- Getting Started with Containerization
- Dreamweaver CS3網頁設計與網站建設詳解
- SharePoint 2010開發最佳實踐
- JavaScript典型應用與最佳實踐
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 工業機器人運動仿真編程實踐:基于Android和OpenGL
- 單片機技術項目化原理與實訓
- 筆記本電腦維修之電路分析基礎
- Cortex-M3嵌入式處理器原理與應用
- 菜鳥起飛五筆打字高手
- 超好玩的Python少兒編程