Ejemplo n.º 1
0
        private void BTN_search_Click_1(object sender, EventArgs e)
        {
            this.txt_input_search.Enabled = false;
            this.BTN_search.Enabled = false;

            string basePath = Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Program)).Location);

            EdgarDownloader edownloader = new EdgarDownloader(basePath + "\\stocks\\edgar\\filings", this.txt_input_search.Text);
            edownloader.Download();
            edownloader.Update();

            FinancialStatementService statementService = new FinancialStatementService();
            var statements = statementService.FinancialsFor(this.txt_input_search.Text);

            FinancialMetricService metricService = new FinancialMetricService();
            metricService.CalculateAndStoreMetrics(statements);

            FinancialModelService modelSerivce = new FinancialModelService();
            modelSerivce.UpdateGrahamAnalysis(this.txt_input_search.Text);
            modelSerivce.UpdateDcfAnalysis(this.txt_input_search.Text);

            this.txt_input_search.Enabled = true;
            this.BTN_search.Enabled = true;

            this.LoadDataEdgarFilings();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            DBUtility db = new DBUtility();
            db.InitTables();

            string basePath = Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Program)).Location);

            string symbol = "AAPL";

            System.Console.WriteLine("Search data for symbol: " + symbol);

            EdgarDownloader edownloader = new EdgarDownloader(basePath+ "\\stocks\\edgar\\filings", symbol);
            System.Console.WriteLine("Download data for symbol: " + symbol);
            edownloader.Download();
            System.Console.WriteLine("Update data for symbol: " + symbol);
            edownloader.Update();

            System.Console.WriteLine("Analysing financial statemant for symbol: " + symbol);

            FinancialStatementService statementService = new FinancialStatementService();
            var statements = statementService.FinancialsFor(symbol);

            System.Console.WriteLine("Analysing financial metrics for symbol: " + symbol);

            FinancialMetricService metricService = new FinancialMetricService();
            metricService.CalculateAndStoreMetrics(statements);

            System.Console.WriteLine("Analysing financial model for symbol: " + symbol);

            FinancialModelService modelSerivce = new FinancialModelService();
            modelSerivce.UpdateGrahamAnalysis(symbol);
            modelSerivce.UpdateDcfAnalysis(symbol);

            System.Console.WriteLine("Done");

            if (Debugger.IsAttached)
            {
                Console.WriteLine("... Press any key to continue ...");
                Console.ReadLine();
            }
        }