Toolkit for performing analysis on indian stock market
Project description
stocks_toolkit_india
Toolkit for NSE/BSE stocks comprises of various functionalities like historical technical data and candle pattern detection.
To Install the package:
pip install stocks-toolkit-india
Note- This library needs TA-lib to be installed. To know more about how to install it https://github.com/mrjbq7/ta-lib
Note- Functionality for Graph and better visualisation of data will be added.
UPDATE - NSE no more allows to get data more than 365 days. This library is designed to provide in depth analysis of recent trend pattern of a stock.
For getting technical Data of a stock, the data is in pandas DataFrame Form.
from stock_toolkit import stock_toolkit
st = stock_toolkit()
stock_df = st.technical_data("INFY","01-01-2021","01-7-2021")
print(stock_df)
| | Symbol | Series | Date | Prev Close | Open Price | High Price | Low Price | Last Price | Close Price | Average Price | Total Traded Quantity | Turnover | No. of Trades | Deliverable Qty | % Dly Qt to Traded Qty |
|---:|:---------|:---------|:------------|-------------:|-------------:|-------------:|------------:|-------------:|--------------:|----------------:|------------------------:|------------:|----------------:|------------------:|-------------------------:|
| 0 | RELIANCE | EQ | 01-Jan-2021 | 1985.3 | 1988 | 1997 | 1982 | 1988 | 1987.5 | 1989.5 | 4.622e+06 | 9.19548e+09 | 139680 | 1.01331e+06 | 21.92 |
| 1 | RELIANCE | EQ | 04-Jan-2021 | 1987.5 | 1995.1 | 1998.9 | 1968 | 1990.25 | 1990.85 | 1982.61 | 1.1313e+07 | 2.24292e+10 | 316871 | 3.8696e+06 | 34.2 |
| 2 | RELIANCE | EQ | 05-Jan-2021 | 1990.85 | 1969 | 1983.6 | 1956 | 1965 | 1966.1 | 1968.87 | 1.11328e+07 | 2.1919e+10 | 300233 | 5.20805e+06 | 46.78 |
| 3 | RELIANCE | EQ | 06-Jan-2021 | 1966.1 | 1965.9 | 1966 | 1905.15 | 1915.5 | 1914.25 | 1928.17 | 2.14143e+07 | 4.12904e+10 | 659284 | 9.0381e+06 | 42.21 |
| 4 | RELIANCE | EQ | 07-Jan-2021 | 1914.25 | 1920.5 | 1945 | 1905.15 | 1912.8 | 1911.15 | 1919.86 | 1.49184e+07 | 2.86413e+10 | 454695 | 6.45266e+06 | 43.25 |
| 5 | RELIANCE | EQ | 08-Jan-2021 | 1911.15 | 1918 | 1938.4 | 1912.1 | 1934 | 1933.7 | 1923.06 | 1.27098e+07 | 2.44418e+10 | 270966 | 5.30355e+06 | 41.73 |
[123 rows x 15 columns]
For getting the candle analysis, candle patter found in the stock:
candles = st.candle_analysis("INFY","01-01-2021","01-7-2021")
print(candles)
| | open | close | high | low | date | candles_found |
|---:|-------:|--------:|-------:|--------:|:------------|:----------------|
| 0 | 1988 | 1987.5 | 1997 | 1982 | 01-Jan-2021 | [] |
| 1 | 1995.1 | 1990.85 | 1998.9 | 1968 | 04-Jan-2021 | [] |
| 2 | 1969 | 1966.1 | 1983.6 | 1956 | 05-Jan-2021 | [] |
| 3 | 1965.9 | 1914.25 | 1966 | 1905.15 | 06-Jan-2021 | [] |
| 4 | 1920.5 | 1911.15 | 1945 | 1905.15 | 07-Jan-2021 | [] |
| 5 | 1918 | 1933.7 | 1938.4 | 1912.1 | 08-Jan-2021 | [] |
.. ... ... ... ... ... ...
| 118 | 1572.00 | 1574.20 | 1578.00 | 1543.00 | 25-Jun-2021 | [CDLDOJI:Bullish, CDLDOJISTAR:Bearish, CDLLONG... |
| 119 | 1572.90 | 1571.80 | 1580.15 | 1560.60 | 28-Jun-2021 | [CDLDOJI:Bullish, CDLHIGHWAVE:Bearish, CDLLONG... |
| 120 | 1561.00 | 1563.05 | 1573.65 | 1559.20 | 29-Jun-2021 | [CDLDOJI:Bullish, CDLGRAVESTONEDOJI:Bullish, C... |
| 121 | 1572.05 | 1580.80 | 1591.00 | 1572.05 | 30-Jun-2021 | [CDLSHOOTINGSTAR:Bearish] |
[123 rows x 6 columns]
The 'candles_found' column contains array of candle name along with their characterstics i.e Bullish/Bearish
CDLGRAVESTONEDOJI:Bullish => Grave Stone Doji candle pattern indicating Bullish behavoiour.
Note - A single array can have candles indicating both Bearish and Bullish behavious. Read more about Japanese Candle stick patterns - https://www.nomuradirect.com/pdf/21_Candlesticks.pdf
Both NSE symbol and BSE symbol can be provided as symbol in both of the above functions. If the data is available with NSE, both of the function will return data.
To convert NSE symbol to bse symbol use:
print(st.nse_to_bse("INFY")))
500209
and to convert bse symbol to nse symbol use:
print(st.bse_to_nse("500325")))
RELIANCE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stocks-toolkit-india-0.1.45.tar.gz
.
File metadata
- Download URL: stocks-toolkit-india-0.1.45.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d165455a41174341764ae69533f81989e5056f367af518cc02916b3caf04f823 |
|
MD5 | 7123decbff4368074ac7e2a8b6724f3f |
|
BLAKE2b-256 | d43e0e5d0adee81f75ab3b1b65b3649216e97e319747ee0ff37481e32f84b370 |
File details
Details for the file stocks_toolkit_india-0.1.45-py3-none-any.whl
.
File metadata
- Download URL: stocks_toolkit_india-0.1.45-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 420bf5599dacec6a3aa7041b38951abce74051d3aab765431af79ff17dd46428 |
|
MD5 | 1014bf48c3c07bb1484b4e2d1c484e46 |
|
BLAKE2b-256 | bd0d9f95df1fdb25a076fd178da55bb9ebd4d4515857c007ad5ca4a56a29ed84 |