Posts

Showing posts with the label Python code to fetch NSE historical stock price

INVESTOCK – Simple Python computer programing code to fetch & back test NSE historical (15+ years) stock price data

Image
F et ch hist orical price data and back test between any two dates of NSE Stocks using this simple Python code and import them in .CSV file and predict the winning percentage. Step 1. Install NSEPY Open Command Prompt (in Windows 10) as Administrator. Then paste the following commands (shown in red ) one after another. C:\Python\python.exe -m pip install --upgrade pip Wait to upgrade... pip install nsepy Wait to upgrade... pip install nsepy –upgrade Wait to upgrade... Screenshot for installation in Windows 10 OS. Step 2. Fetching the price data Now open Python IDLE and paste the following code. Save it with a suitable filename, with an extension '.py'. Stock symbols and Date Enter the equity code as in NSE, India. Example: “TCS”) Enter starting and closing date digits, in the format, “yyyy,mm,dd” Example: “7-Aug-2021” is entered as: “2021,8,7") Change Symbol and starting as well as closing date in the required format. The data will be saved as .CSV file. Code Copy and past