Nano Course On Python For Trading
==========================
Module 2

In this post, I will attempt to show a simple Python code to download the past 5 years' Nifty50 stocks EOD Data using the NSEpy library in less than 2

The first few lines are simple to import statements. Pulling public library NSEpy https://t.co/OW1TPC7QXC that we can use to extract historical and real-time data from NSE’s website. Then, we import the most popular pandas library.
Then I define a function "fetchData" that fetches the data using the built-in get_history function of the nsepy library. I adjust the original data frame to store open, high, low and close prices. The original data frame sends more columns - Volume, Turnover, %Deliverable, etc.
I then go ahead and put all Nifty50 tickers in a Python list named nifty50list. I also set our start-date (2014-01-01), end-date(2022-01-21) in the YYYY-MM-DD format, and the path where I want to save my files on my PC.
Finally, I loop through all the Nifty50 tickers calling the fetchData function on each of them and saving them in the path specified above in the CSV format e.g. ADANIPORTS.csv, which came first. This process is repeated for each and every symbol in Nifty50.
The result is 2 minutes to download 50 stocks worth of data! Each ticker's data is saved in a file named Ticker.csv You can visit this colab notebook and try out your hands with the code https://t.co/HDB94AATFr
In Module 3, we will learn to use this data to create and test some trading strategies. Until then, take care and have a great time learning.
Note: NSE website official Terms of Use section 22.f reads as below:

22. Specific Prohibited Uses:

The Site may be used only for lawful purposes by individuals for personal, non-commercial use only. NSE specifically prohibits any other use of the Site.

You May Also Like

I hate when I learn something new (to me) & stunning about the Jeff Epstein network (h/t MoodyKnowsNada.)

Where to begin?

So our new Secretary of State Anthony Blinken's stepfather, Samuel Pisar, was "longtime lawyer and confidant of...Robert Maxwell," Ghislaine Maxwell's Dad.


"Pisar was one of the last people to speak to Maxwell, by phone, probably an hour before the chairman of Mirror Group Newspapers fell off his luxury yacht the Lady Ghislaine on 5 November, 1991."
https://t.co/DAEgchNyTP


OK, so that's just a coincidence. Moving on, Anthony Blinken "attended the prestigious Dalton School in New York City"...wait, what? https://t.co/DnE6AvHmJg

Dalton School...Dalton School...rings a

Oh that's right.

The dad of the U.S. Attorney General under both George W. Bush & Donald Trump, William Barr, was headmaster of the Dalton School.

Donald Barr was also quite a


I'm not going to even mention that Blinken's stepdad Sam Pisar's name was in Epstein's "black book."

Lots of names in that book. I mean, for example, Cuomo, Trump, Clinton, Prince Andrew, Bill Cosby, Woody Allen - all in that book, and their reputations are spotless.