Company Tracker

403 views

Published on

Company Tracker is a database of companies and their key financial
ratios. It’s compatible with Reuter’s Kobra data exported in tab
delimited format and also with Google Finance.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
403
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Company Tracker

  1. 1. Company Tracker | CIS 4100 May 18, 2009 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  2. 2. Overview 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 <ul><li>Purposes </li></ul><ul><li>Track Company Financial Data </li></ul><ul><li>Compare a fundamentals </li></ul><ul><ul><li>PE </li></ul></ul><ul><ul><li>EPS </li></ul></ul><ul><ul><li>Dividend Yields </li></ul></ul><ul><ul><li>ROE </li></ul></ul><ul><ul><li>And other ratios </li></ul></ul><ul><li>Evaluate Technical Data </li></ul><ul><ul><li>Visualize Historical Data </li></ul></ul>
  3. 3. Program Design Classes 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  4. 4. Importing Data <ul><li>Reuters Data Compatible through Excel tab delimited files </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  5. 5. Importing Data <ul><li>Tab Delimited Files </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  6. 6. Importing Data <ul><li>Loading data after a compatible file has been loaded. Notice how the RIC from Reuters has been change to a standard ticker, and company name has been formatted to lowercase. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  7. 7. Browse Button 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 /* creating new open file dialog box*/ OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog(); /* setting filters for compatible data*/ openFileDialog1->Filter = &quot;Text File (Tab Delimited)|*.txt&quot;; openFileDialog1->Title = &quot;Select a File&quot;; /*the dialog box is shown automatically*/ /*when the dialog box is closed get the file path*/ if(openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK){ /*get the path received into the textbox*/ txtPath->Text = openFileDialog1->FileName; }
  8. 8. Importing Companies 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 companyImportList->Add(gcnew CCompany(columns[0], columns[1], columns[2], Convert::ToInt64(columns[4]), Convert::ToDouble(columns[5]), Convert::ToDouble(columns[6]), Convert::ToDouble(columns[8]), Convert::ToDouble(columns[9]), Convert::ToDouble(columns[10]), Convert::ToDouble(columns[11]))); CompaniesDB->ImportCompanies(companyImportList); companyImportList = gcnew List<CCompany^>(); StreamReader
  9. 9. Importing Data <ul><li>Text files must have twelve columns of data. </li></ul><ul><li>Data consistency and program stability. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  10. 10. Checking Compatibility 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 // read contents of file while(txtIn->Peek() != -1){ // read lines of text String^ row = txtIn->ReadLine(); // split line to find # of columns array<String^>^ columns = row->Split(' '); /*checks if the file is compatible*/ if(columns->Length!=12){ MessageBox::Show(&quot;The selected file is not compatible.&quot;, &quot;Error Reading File&quot;, MessageBoxButtons::OK ,MessageBoxIcon::Error); break; }else{…….}
  11. 11. Company Management <ul><li>Mimics a Database using classes to load and save list of company objects into text files </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  12. 12. Program Design: Company Management Classes 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  13. 13. Company Management: Sorting Companies <ul><li>Using a ListView control and a ListViewItemSorter class, data can be sorted. This allows company performance comparison. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  14. 14. Sorting Companies 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 // creates a list view item comparer CListViewItemComparer^ lviComparer = gcnew CListViewItemComparer(e- >Column); // set the order and apply it to the listview control if(e->Column == lastColSorted){…… } //apply the comparer to the listview listView1->ListViewItemSorter = lviComparer ; //set flags lastColSorted = e->Column; lastSortOrder = lviComparer->Order; //apply row colors to list view AlternateRowColorListView();
  15. 15. Company Management: Searching Companies <ul><li>The user can search for companies using the search box. While text is being entered the possible matches are highlighted in the company list. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  16. 16. Searching a Company 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 /* get item from listview */ ListViewItem^ resultLvItem = listView1-> FindItemWithText(ticker); if(resultLvItem != nullptr){ /* select item and ensure is visible */ resultLvItem->Selected = true; listView1->EnsureVisible(resultLvItem->Index); }
  17. 17. Company Management: Adding Companies 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 <ul><li>Dropdown combo box allows easily selection of sectors. </li></ul><ul><li>Sectors are loaded using a Sectors object </li></ul>
  18. 18. Company Management: Adding Companies <ul><li>Data validation allows data consistency and offers aid to the user when manually adding companies. </li></ul><ul><li>If a company already exists in the database, inform the user and prevent adding the duplicate data. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  19. 19. Adding a Company to the DB 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 frmAddCompany^ FAddCompany = gcnew frmAddCompany(); CCompany^ newCompany = FAddCompany->GetNewCompany(); /* if the company object received is not null save it*/ if(newCompany != nullptr){ /* check if the company exists*/ if(CompaniesDB->CompanyExists(newCompany)){ MessageBox::Show(&quot;The company &quot; + newCompany- >Ticker + &quot; already exists.&quot;,&quot;Company Already Exists&quot;); }else{ /*adding company*/ CompaniesDB->AddCompany(newCompany); /* update list view*/ UpdateListView(); } }
  20. 20. Company Management: Editing Companies <ul><li>Companies can be edited by selecting a company from the database and clicking on the edit button. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  21. 21. Editing Companies 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 // get the selected item ListViewItem^ itemSelected = listView1->SelectedItems[0]; CCompany^ selectedCompany = CompaniesDB->GetCompany(itemSelected->Text); frmAddCompany^ FEditCompany = gcnew frmAddCompany(); CCompany^ editedCompany = FEditCompany->EditCompany(selectedCompany); if(editedCompany != nullptr){ /* replace company */ CompaniesDB->AddCompany(editedCompany); CompaniesDB->RemoveCompany(selectedCompany); /* update listview*/ UpdateListView();
  22. 22. Company Management: Deleting Companies <ul><li>To delete a company from the database just select it and click delete, after the confirmation appears click yes. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  23. 23. Deleting a company 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 // get the selected item ListViewItem^ itemSelected = listView1->SelectedItems[0]; CCompany^ selectedCompany = CompaniesDB->GetCompany(itemSelected->Text); if(selectedCompany != nullptr){ // get delete confirmation String^ msg = &quot;Are you sure you want to delete &quot; + selectedCompany->Ticker + &quot;?&quot;; ::DialogResult button = MessageBox::Show(msg, &quot;Comfirm Delete&quot;, MessageBoxButtons::YesNo); if(button == ::DialogResult::Yes){ CompaniesDB->RemoveCompany(selectedCompany); UpdateListView(); }
  24. 24. Company Details 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  25. 25. SendToCompanyDetails(Ccompany) 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 // make sure the detail's form for that company is closed if(!IsCompanyDetailsOpen(someCompany->Ticker)){ // initialize and show child form /*setting child window*/ FCompanyDetails = gcnew frmCompanyDetails(); FCompanyDetails->MdiParent = this->MdiParent; FCompanyDetails->Text = someCompany->Ticker + &quot; - Company Details&quot;; /* setting position */ FCompanyDetails->StartPosition = FormStartPosition::CenterParent; /*send company to form */ FCompanyDetails->DisplayCompany(someCompany); FCompanyDetails->Show();
  26. 26. Company Details: Overview <ul><li>Displays Fundamentals, competitors and a chart to visualize historical quotes. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  27. 27. Company Details: Downloading Quotes <ul><li>After clicking the button data is automatically downloaded and stored in the hard drive for future reference. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  28. 28. Downloading Quotes 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 ticker = ticker->ToUpper(); String^ downloadFolder = &quot;C://files//FINA//PRICEDATA//&quot;+ ticker +&quot;.csv&quot;; String^ website = &quot;http://www.google.com/finance/historical?q=&quot; + ticker + &quot;&output=csv&quot;; try{ /* creates a new WebClient object */ WebClient^ wc = gcnew WebClient(); /* download file to assign download folder */ wc->DownloadFile(website,downloadFolder); /* if file downloaded successfully */ MessageBox::Show(&quot;Company data for &quot; + ticker + &quot; downloaded successfully.&quot;, &quot;Data Downloaded&quot;); /* get a company object from the label ticker and redraw a chart*/ DrawChart(someCompany); }catch(WebException^ e ){/* File could not be downloaded */...}
  29. 29. Program Design: Sectors and Historical Data 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 /* load companies from file into memory */ CompaniesDB->LoadCompanies(); /* get a list of companies by sector */ List<CCompany^>^ companiesBySectorList = CompaniesDB->GetCompaniesBySector(someCompany->Sector); /* get historical data */ List<COHLC^>^ ohlcList = someCompany->GetHistoricalData();
  30. 30. Charting Data 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 if(someCompany->HistoricalDataExists()) { /* setting chart style */ chart1->Series[&quot;Prices&quot;]->ChartType = SeriesChartType::Line; /* enable chart options */ groubBxChartOptions->Enabled = true; rdbtnLine->Checked = true; /*Historical Data Status */ lblHistoricalDataStatus->Text += &quot; was last updated on: &quot; + someCompany->HistoricaDataLastUpdated(); /* set series to be drawn in the chart*/ for each(COHLC^ item in ohlcList){ chart1->Series[&quot;Prices&quot;]->Points->AddXY( item->Date,item->Open, item->High,item->Low, item->Close); }…}
  31. 31. Company Details Chart <ul><li>Company details, displays fundamental data along competitors and a chart of the historical prices for the last year. </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  32. 32. Company Details Chart Options 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  33. 33. Company Details Chart Options <ul><li>Line chart, last three months </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  34. 34. 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 Company Details Chart Options <ul><li>Stock chart, last three months </li></ul>
  35. 35. Company Details Chart Options 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 <ul><li>Candlestick style and three months back. </li></ul>
  36. 36. Viewing Multiple Companies <ul><li>MDI Applications: Multiple Document Interface </li></ul>10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  37. 37. Program Design: Tracking Events Class 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  38. 38. Tracking Events: Adding Events 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  39. 39. Adding Events 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 ListViewItem^ lvitem = gcnew ListViewItem(dtpDate->Value.ToShortDateString()); lvitem->SubItems->Add(txtTicker->Text->ToUpper()); lvitem->SubItems->Add(txtEvent->Text); lvEvents->Items->Add(lvitem); EventsDB->SaveEvents(); /*initialize Events DB */ EventsDB = gcnew CCalendarEvents(); /* link the DB to a list view control */ EventsDB->LinkToListView = lvEvents; /* load all data into the liked listview*/ EventsDB->FillEvents();
  40. 40. Tracking Events: Viewing and Deleting Events 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  41. 41. Program Design: Other Classes 10/10/10 Jaime Moran - CIS 4100 - Spring 2009
  42. 42. File Structure 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 Directory Companies.txt events.txt
  43. 43. File Structure: Historical Quotes 10/10/10 Jaime Moran - CIS 4100 - Spring 2009 GOOG.csv

×