Daily nse advance decline ratio of nse using Python

Hi,



How do I get daily NSE advance decline ratio using Python. As I understand there is no free API for NSE. Please suggest



Thanks

Hey Vishal,



First, you can refer to this blog to get the daily stock market data using Python.



Then, to calculate the daily advance-decline ratio, you can follow these steps:

  1. Obtain the list of stocks that constitute the index you're interested in. This information can typically be found on sources like Wikipedia or the official exchange website, such as NSE India.
  2. Get the historical price data for these stocks for the last two trading days.
  3. Calculate the price difference or percentage change for each stock between the two days.
  4. Count the number of stocks with positive price changes as advances and the number of stocks with negative price changes as declines.
  5. Calculate the ratio of advances to declines to get the advance-decline ratio for the day.
You can implement this logic in Python and let us know if you encounter any challenges while coding. If you're new to Python and need to learn the basics, you can check out our free course on Quantra called "Python for Trading: Basics."

Hope you find this helpful!

Thanks
Rushda

Thank you. This is helpful.