Writing a code to extract daily returns of stock market indices from date to date. advance decline number of stocks in a given index in a given time period. Using data from Yahoo finance or investing.com
plZ SEND ME CODE
You can refer to the below blog to get the daily prices of the stock market indices. And from the prices, you can compute the returns using the convenient pct_change method.
https://blog.quantinsti.com/stock-market-data-analysis-python/
For advance-decline number, you can follow the below steps
- Get the list of stocks that make up the index. you can get this from Wikipedia or the exchange website such as nseindia
- Get the price data for the last two days
- Calculate the difference or percentage change
- Count the positive ones as advance and negative ones as decline
- Take the ratio of advance and decline
You can try coding this and let us know if you face any issues while coding. if you need to learn about Python language then you can check our free course on Quantra 'Python for Trading: basics"
Thank you can you please tell how to calculate below
I need daily returns for nifty50, midcap100, smallcap100 for Nov month - each day
I need no of stocsk advanced vs declined in Nov for all above indices
This is my task of office and today is my first day can to plz code and send me vnaranje8@gmail.com or here
This is my task of office and today is my first day can to plz code and send me vnaranje8@gmail.com or here
Hi Vikas
We are here to help you in case you try it out yourself, face an error, try and troubleshoot it and still can't figure it out.
In case you do that, you can share your code and the exact error you face so that we can assist you in the right manner.
Hope this helps