Trading using Option Sentiment Indicators

I was going through this course, while I really like it, I have no idea how to get Indian Stock market data to implement TRIN Strategy and PCR Strategy. Can you give me a link of it from the Quandl website ? I was unable to get all the required data to implement those strategies in python.



Thank you in advance for the help :slight_smile:

Hi Abinash



To get data for Indian stock markets you can use NSEpy python library.



Link for example: http://nsepy.readthedocs.io/en/latest/



Thanks!

Ishan

Thanks, I was able to set a code to retrieve data using the NSEpy library. But I do not know how to call for the data that we need for TRIN indicator’s calculations. Number of advancing Stocks, Number of Declining Stocks and their respective volumes.

data = nsepy.get_history(symbol=‘NIFTY’, start=start_date, end=end_date, index=True) This returns only 6 columns which unfortunately doesn’t have the data we need to compute TRIN.

You need to define a list of stocks (say stocks in Nifty50) then pull data for those stocks to determine advancing, declining and volumes. Thanks!

Oh, so I have to build that dataframe myself. Got it, Thanks. I wish it was as easy as it was shown on the course lmao.