Пример #1
0
        public static double getStockNetProfitRatio(string stockID, string year, string quarter)
        {
            StockProfitData pd = StockDBVisitor.getInstance().getStockProfitData(stockID, year, quarter);

            if (pd == null)
            {
                return(-double.MaxValue);
            }

            return(pd.net_profit_ratio);
        }
        public static double getStockNetProfit(string stockID, string year, string quarter)
        {
            StockProfitData pd = StockDBVisitor.getInstance().getStockProfitData(stockID, year, quarter);

            if (pd != null)
            {
                return(pd.net_profit);
            }

            return(0.0);
        }
Пример #3
0
        public static double calcPBCostValue(string stockID, string year, string quarter)
        {
            double          costRefVal = 0.0;
            double          pe         = 0.0;
            StockReportData rd         = StockDBVisitor.getInstance().getStockReportData(stockID, year, quarter);

            if (rd == null)
            {
                return(double.MaxValue);
            }

            List <StockKLine> mk = StockDataCenter.getInstance().getMonthKLine(stockID);

            if (mk == null)
            {
                return(double.MaxValue);
            }

            string     targetMonth = convertMonthBySeason(quarter);
            StockKLine kl          = StockDataUtil.getMonthKLineByYearMonth(mk, year, targetMonth);

            if (kl == null)
            {
                return(double.MaxValue);
            }
            pe = kl.latestPrice / rd.eps;

            StockProfitData pd = StockDBVisitor.getInstance().getStockProfitData(stockID, year, quarter);

            if (pd == null)
            {
                return(double.MaxValue);
            }

            costRefVal = pe * pd.roe;

            return(costRefVal);
        }