Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A Python library for trading in the Indian Finance Sector with support for multiple broker APIs.
A Python library for trading in the Indian Finance Sector with support for many broker APIs.
The Fenix library is used to connect and trade with brokers in the Indian Financial Markets. It provides quick access to market data, order palcemement, etc. for storage, analysis, visualization, indicator development, algorithmic trading, strategy backtesting, bot programming, and related software engineering.
It is intended to be used by coders, developers, technically-skilled traders, data-scientists and financial analysts for building trading algorithms.
Current feature list:
The fenix library currently supports the following 16 indian brokers and their trading APIs:
Logo | Id | Name | Supported |
---|---|---|---|
aliceblue | AliceBlue | 🟢 | |
angelone | AngelOne | 🟢 | |
choice | Choice | 🟢 | |
finvasia | Finvasia | 🟢 | |
fivepaisa | 5paisa | 🟢 | |
fyers | Fyers | 🟢 | |
iifl | IIFL | 🟢 | |
kotak | Kotak | 🟢 | |
kotakneo | Kotak Neo | 🟢 | |
kunjee | Kunjee | 🟢 | |
mastertrust | Master Trust | 🟢 | |
motilaloswal | Motilal Oswal | 🟢 | |
symphony | JM Financial | 🟢 | |
upstox | Upstox | 🟢 | |
vpc | VPC | 🟢 | |
zerodha | Zerodha | 🟢 |
pip install fenix
import fenix
print(fenix.brokers)
# print a list of all available exchange classes
Read the Manual for more details.
The fenix library provides unifed methods for fetching market data, generating access tokens, placing different order types, fetching orderbook & tradebook, fetching order updates, etc.
In order to trade you need to provide your user credentials. It usually means signing up to the broker and creating API keys for your account. Some exchanges require personal info or identification. Sometimes verification may be necessary as well. In this case you will need to register yourself, this library will not create accounts or API keys for you.
Using this library you can perform the following:
# coding=utf-8
from fenix import aliceblue, angelone, zerodha, iifl
from fenix import constants
# Download all the FNO Intrument Tokens, Symbols, Lot Size
nfo_tokens = zerodha.create_fno_tokens()
# Create Headers which contain Access Token used to place orders, fetch orderbook, etc.
params = {
"user_id": "YOUR_USER_ID",
"password": 'YOUR_PASSWORD',
"totpstr": 'YOUR_TOTP_STRING',
"api_key": 'YOUR_API_KEY',
"api_secret":'YOUR_API_SECRET'
}
headers = zerodha.create_headers(params)
# Place a Limit Order in the FNO Segment
limit_order = zerodha.limit_order_fno(
price = 13.0,
option = "CE",
strike_price = 45500,
quantity = 15,
side = "BUY",
unique_id = 'LIMITOrderNFO',
headers = headers,
)
# Fetch the current detail of a single order
order_detail = zerodha.fetch_order('ORDER_ID', headers)
# Modify an open order
modified_order = zerodha.modify_order(
order_id='231217000002374',
price=10.0,
trigger=9.5,
quantity=15,
order_type=constants.OrderType.SL,
validity=constants.Validity.DAY,
headers=headers
)
# Cancel an open order
cancelled_order = zerodha.cancel_order(
order_id='231217000005603',
headers=headers
)
# Fetch OrderBook
orderbook = aliceblue.fetch_orders(headers=headers)
print(aliceblue.id, aliceblue.create_fno_tokens())
print(angelone.id, angelone.create_fno_tokens())
FAQs
A Python library for trading in the Indian Finance Sector with support for multiple broker APIs.
We found that fenix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.