Stock Analysis

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Stock Analysis as PDF for free.

More details

  • Words: 2,004
  • Pages: 7
Stock Analysis Installation.................................................................................................................................................2 Execution: Generate Buys .........................................................................................................................2 Initial Execution ..................................................................................................................................2 Download Data...................................................................................................................................2 Analyze Data......................................................................................................................................2 File Layout ................................................................................................................................................3 Buttons .....................................................................................................................................................4 Settings..............................................................................................................................................4 Tools..................................................................................................................................................5 Show Graph .......................................................................................................................................5 Show Text ..........................................................................................................................................5 Redraw Graph....................................................................................................................................5 Status ................................................................................................................................................5 Update CM.........................................................................................................................................5 Update Futures...................................................................................................................................5 Archive Files ......................................................................................................................................5 Merge Scrips......................................................................................................................................5 Reset Scrip List ..................................................................................................................................5 Do Analysis 1 .....................................................................................................................................6 Display Analysis .................................................................................................................................6 Today’s Buys......................................................................................................................................6 Search Stock in Current Buys .............................................................................................................6 Known Issues............................................................................................................................................6 To Be Done...............................................................................................................................................6 Version 1.1 Notes......................................................................................................................................7 Issues Fixed .......................................................................................................................................7 New Implementation...........................................................................................................................7 Upgrading to version 1.1............................................................................................................................7

Installation 1. 2. 3. 4. 5.

Download the file stkanalysis.zip Download and install WinZip from any site like download.com Install WinZip Unzip stkanalysis.zip using WinZip I would prefer unzipping in a directory like c:\StockAnalysis. The stkanalysis.zip file is itself about 29 MB since it contains the data for NSE Cash market since 1994 and Futures data since 2000 or so.

Execution: Generate Buys Initial Execution 1.

Run StockAnalysis.exe. This could be achieved by A. Creating a desktop Icon. In this case make sure the "start in" directory is given correctly where StockAnalysis.exe resides B. Use Explorer to navigate to the directory and double click on StockAnalysis.exe

Download Data 1. 2.

To update Cash Market Data Click on the "Update CM" Button. It will perform the following steps A. Download all cash market Files from NSE B. Add the data to tables created in the .\datafiles directory To Update Futures Data Click on "Update Futures" button. It will perform the following steps A. Download all Futures Files from NSE B. Add the data to the FUTIDX table in the .\datafiles directory. Note only Futures data for the near month is updated.

Analyze Data 1. 2. 3. 4.

Click on the "Do Analysis 1" button to analyze the tables in .\datafiles directory. Wait for "Complete..." to appear in the status window. Click on "Display Analysis" button to display the analysis Click on "Today's Buys" button to list stocks that are generated as buys for the next trading day.

File Layout This program consists of the following files that can be found in .\analysis directory unless explicitly mentioned. 1. StockAnalysis.exe: The main executable file. 2. properties.txt: This is the files that stores data related to Cash Market data download. This contains the following defaults that can be modified here a. URL: This is a sample URL. This is the string used to download data. Can be modified to download data from another website. b. datadir: This indicates the directory to which the data files are to be downloaded. c. Syear: The year from which to start the download d. Smonth: The month from which to start the download e. Sday: The day from which to start the download f. Eyear, emonth, eday: The date at which the download is to be stopped g. Year String Length: This is the length of the string in the embedded URL. This is not to be changed as of now. For future downloads can be customized. h. Daypos1-4: Theses are the positions where the day is embedded in the URL. Upto 4 such days in URL can be stored. i. monthpos1-4: Theses are the positions where the month is embedded in the URL. Upto 4 such months in URL can be stored. j. yearpos1-4: Theses are the positions where the year is embedded in the URL. Upto 4 such years in URL can be stored. k. Monthstr: This is a variable used to resolve the month string in the URL. l. Century: This indicates the beginning of the century. It is 2000 as of now and will change to 3000. Hmmm… Something we won’t get to see. 3. propertiesfo.txt: This is the files that stores data related to Futures data download. This stores the default data for futures data. All the fields are similar to properties.txt 4. prop.txt: This is the files that stores data related to Cash Market data Tables. Has fields similar to properties.txt. The ones that are different are a. datapath: Where data files reside with an example file. b. Totalscrips: This is not used as of now. 5. propfo.txt: This is the files that stores data related to Futures data Tables. All fields are similar to pro.txt 6. lastdata.txt: Stores the date of the last data file for Cash Market that was processed. Single digit day and month should have 0 to begin with. 7. lastdata.txt: Stores the date of the last data file for Futures that was processed. Single digit day and month should have 0 to begin with. 8. analysis.txt will be generated on running a straight line analysis from the Tools TAB. 9. STOCKS.INI: Dummy as of now. Contains the data file attributes path.

10. stkanal.ini: The values found here are taken from the stkanal.ini file in the .\inifiles directory. It by default contains the following values that can be changed. Let us analyze each line... a. SCRIPTODISPLAY=datafiles\RELIANCE. b. This means when the program starts the graph that is show is for the stock RELIANCE and it is also selected in the listbox containing the stock list. c. EMADAYS1=100 d. EMADAYS2=10. These are the 2 EMA days values used for the graph. You could change it here to a default value of your choice. e. FNOFILEPATH=datafiles\FUTIDX. This is kept for later use. DO NOT CHANGE THIS SINCE TABLE WILL BE CREATED IN THIS DIRECTORY f. TOTALSCRIPS=3000. This is the maximum Scrips that can be loaded in memory while creating tables. This can be changed if Scrips become more than 3000. As of now no need of changing g. NUMBEROFRECORDSTOWRITEONCE=200. This is useful since first time we create data we would write whole lot of records as much as 3500+ for reliance. Memory allocation is done for this value so that number of writes is less. Advisable not to change. Or can be lowered if there is lack of memory. h. IMPROPERDOWNLOAD=< DO NOT CHANGE. This is to check if the data downloaded is valid or not for a given day. i. PERIODLOW=250. This is the value for the snapshot window. Approximates to 52 weeks. j. ARCHIVEFROMDATE=01-01-2007. This is the cut off date. Stocks that are not traded after this date will be moved to the .\archives directory k. GENERATEBUYDAYS=20. This is the previous days for which buy days will be generated. Setting this to 0 will generate buys from the beginning when data is available. l. DOWNLOAD_PROPERTIES_FILES=analysis\properties.txt,analysis\propertiesfo.txt This is a value to be used later when the s/w will be modified to say use NYSE data. m. SELECTEMA=1. This is for the purpose of drawing graphs. A value of 1 means an EMA graph is drawn in the graph window. 0 will result in DMA graph being drawn. 11. scp1.csv: This is the file that is generated when analysis is done by clicking the “Do Analysis 1” method. This is a excel readable format. The file as a whole is displayed when “Display Analysis” button is clicked. The file is parsed and buys for the day are filtered and displayed when “Today’s Buys” button is clicked. 12. merge.dat: This is the file that contains names of Scrips that can be merged. As an example HLL is given in the file that can be found in the directory inifile. In the next version this will be moved to the analysis directory. Do delete the file when merge is done once.

Buttons Settings 1 2 3 4

Enter EMA Days: This is where one can change values for the 2 EMA values and graphs will be drawn accordingly Calculate: Select EMA or DMA to draw EMA or DMA graphs respectively Archive Date: Date after which scrip with no trade will be moved to archive directory... Who cares for history anyway... LOL... Enter Buy days: This is the days for which analysis will be displayed... So if value is 20 all stocks that came up for buy in the last 20 days will be displayed with the gains that have been made when one clicks the Display Analysis button. Giving a value of 0 will display buys from the time data is available...

Tools 1 2

3 4

Create EMA File: a. Currently Selected Scrip: Selecting this will create an EMA file with current EMA values taken in the .\csvdata directory. Reset Scrip List: a. All: Listbox will be filled with all Scrips b. Today’s Buys: Listbox will be reset with Today’s buys that are generated c. Last 2 Days Buys: Listbox will be reset with buys generated for the last 2 days All Buys: Listbox will be reset with all the buys currently generated Straight Line Analysis: a. Loss Analysis: Enter 2 negative values and all instances on which on a straight line basis such losses occurred will be consolidated into the analyis.txt file. b. Gain Analysis: Enter 2 positive values and all instances on which on a straight line basis such gains occurred will be consolidated into the analyis.txt file.

Show Graph This button is used the DMA/EMA graph.

Show Text This button is used the DMA/EMA in the text form.

Redraw Graph Only useful when another action is performed that affects the currently selected scrip. Example: When you download data and update tables the latest value is not included. So click on redraw graph to read the tables again and display values

Status The bar below shows text status. Initially it will say waiting... Then a bar goes around and on completion of action will say Complete...

Update CM This is to download Cash Market Data and Update tables. It can be individually accomplished by doing them from the menu. File>>UpdateData and File>>Create Tables.

Update Futures This is to download Futures data and update FUTIDX table with near month values.

Archive Files Selecting this option will move Scrips not traded before the entered date into .\archives directory. This is useful since analysis will take less time.

Merge Scrips Edit inifiles\merge.dat to merge 2 or more tables. Open the file to find an example and do it. Do NOT REPEAT WITH SAME FILES in merge.dat. See merge.dat file description for more details.

Reset Scrip List Reset the entire scrip list again. Example the list could be filled with todays buys using Tools. This will be used to set the listbox with all the Scrips.

Do Analysis 1 Do the Analysis(Hopefully 2, 3 and 4 will follow)...

Display Analysis Display the Analysis. See scp.csv file description for details.

Today’s Buys Selecting this option will display buys generated for the next trading day.

Search Stock in Current Buys Selected stock will be searched for a buy generation. If the scrip is found, it will be displayed at the top of display scrip analysis display window.

Known Issues 1 2

Straight Line analysis for gains still not implemented. Window scroll not provided while displaying EMA values in the text form

To Be Done 1

Vertical and Horizontal Scrolling for all windows

Version 1.1 Notes Issues Fixed 1. 2. 3.

Straight Line Analysis for gains implemented Window Scroll provided while displaying EMA values in the text form Please move merge.dat to the .\analysis directory and remove the .\inifiles directory. Update the merge.dat and Click merge scrips to merge 2 or more scrips.

New Implementation 1.

A new functionality that analyses between 2 dates implemented. What this does is i. Takes 2 dates, a Begin Date and an End Date ii. Takes the first closing value on or after begin date iii. Takes the first Closing value on or after End Date iv. Does a B-A for all the scrips in the listbox. v. So if the Listbox has only Today’s buys only those will be analyzed.

Upgrading to version 1.1 Follow the following steps. 1. Download StockAnalysisv1.1.zip 2. Extract the lone file embedded StocksAnalysis.exe to the same folder where StockAnalysis.exe resides 3. Move merge.dat from .\inifiles directory to .\analysis directory 4. Modify merge.dat in case you want to merge files. This is since when a name change occurs too NSE renames the CODE. For example HLL changed name to HUL leading to CODE change. This is provided in the merge.dat as an example

Related Documents