Skip to main content

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 stocks_toolkit import stocks_toolkit
st = stocks_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

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]

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stocks-toolkit-india-0.1.49.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

stocks_toolkit_india-0.1.49-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file stocks-toolkit-india-0.1.49.tar.gz.

File metadata

  • Download URL: stocks-toolkit-india-0.1.49.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

Hashes for stocks-toolkit-india-0.1.49.tar.gz
Algorithm Hash digest
SHA256 d2b36b92fe808503e191401df49641476d5a5ac918e35ec042d67851bcb84735
MD5 e885da39c411f5e6019743113325fea3
BLAKE2b-256 5e0ea34fb6793a5ed9c73fb348a1542773f636a8358bec7f5984c6ff6b925042

See more details on using hashes here.

File details

Details for the file stocks_toolkit_india-0.1.49-py3-none-any.whl.

File metadata

  • Download URL: stocks_toolkit_india-0.1.49-py3-none-any.whl
  • Upload date:
  • Size: 28.2 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

Hashes for stocks_toolkit_india-0.1.49-py3-none-any.whl
Algorithm Hash digest
SHA256 5076630a05d4dca729f482f1b50bbd12bc8e5259770eaa27dd4f37486c7d22e1
MD5 73d76c87a5838f1e051c04209a8f5da1
BLAKE2b-256 81b51508057386b4756e805ba88c217e204f0d488d1524da170e608201f9a29d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page