public string GetCharMapping(IStockHistory hist)
        {
            string totalMapping = "";
            DateTime startDate = hist.MinDate;
            DateTime endDate = hist.MaxDate;

            while (startDate < endDate)
            {
                IStockData todayData = hist.GetStock(startDate);
                IStockData pervData = hist.GetPrevDayStock(startDate);

                if (todayData == null)
                {
                    startDate = DateFunc.GetNextWorkday(startDate);
                    continue;
                }

                string s = ParseChars(pervData, todayData);

                if (!string.IsNullOrEmpty(s))
                {
                    totalMapping += s + "|";
                }

                startDate = DateFunc.GetNextWorkday(startDate);
            }

            return totalMapping;
        }
Beispiel #2
0
        public string GetCharMapping(IStockHistory hist)
        {
            string   totalMapping = "";
            DateTime startDate    = hist.MinDate;
            DateTime endDate      = hist.MaxDate;

            while (startDate < endDate)
            {
                IStockData todayData = hist.GetStock(startDate);
                IStockData pervData  = hist.GetPrevDayStock(startDate);

                if (todayData == null)
                {
                    startDate = DateFunc.GetNextWorkday(startDate);
                    continue;
                }

                string s = ParseChars(pervData, todayData);

                if (!string.IsNullOrEmpty(s))
                {
                    totalMapping += s + "|";
                }

                startDate = DateFunc.GetNextWorkday(startDate);
            }

            return(totalMapping);
        }
Beispiel #3
0
        // 股票市值
        public double MarketValue(DateTime day)
        {
            IStockData stockProp = History.GetStock(day);

            if (stockProp == null)
            {
                stockProp = History.GetPrevDayStock(day);
            }

            if (stockProp != null)
            {
                return(_CurrentStock.Count * stockProp.EndPrice);
            }
            else
            {
                return(0);
            }
        }