Experimental code to fetch data from mcx. Do not use this code to programmatically get data from mcx exchange. This code is uploaded here only for educational purpose. The uploader is not liable for any type of damage caused by or arising from the use of this code.
Installation:
mcxpy installer is available on PyPI:
pip install mcxpy
from mcxpy import *
All Functions outputs are in pandas dataframe/datetime.datetime
-
mcx_bhavcopy(bhavdate)
Fetch the bhacopy of the given date
-
mcx_circulars(from_date, to_date)
Fetch Circulars. By default it will return last 4 days circulars.
***Below Functions names are self-explanatory.
-
mcx_marketwatch()
-
mcx_topgainers()
-
mcx_toploosers()
-
mcx_mostactiveoptions()
-
mcx_mostactivecontracts()
-
mcx_heatmap()
-
mcx_expiry(commodity, instrument, expirytype)
By defaults, it returns the current expiry of Crudeoil options
mcx_expiry()
datetime.datetime(2023, 7, 17, 0, 0)
mcx_expiry(commodity='NATURALGAS',instrument='future',expirytype='current')
datetime.datetime(2023, 7, 26, 0, 0)
- mcx_optionchain(commodity, expiry)
Fetch the optionchain.
- mcx_pcr(expirywise)
Returns the pcr. By default expirywise is False (Returns
commoditywise pcr)
- mcx_icomdexindices(datatype,start_date, end_date)
start_date and end_date are needed only for historical datatype. By
defaults returns today's data
-
mcx_quote(commodity,instrument, expiry, optiontype, strikeprice,outputtype)
Fetch quote of the given commodity. optiontype and strikeprice needed only for option instrument.