public static void filterStocksByPriceScaleAndPE(double ratio, double pe, string filepath) { List <string> stocks = new List <string>(); PEFilter peFilter = new PEFilter(pe); PriceScaleFilter priceFilter = new PriceScaleFilter(ratio); List <string> shStocks = peFilter.filter(priceFilter.filter(StockPool.getInstance().allSHStocks)); List <string> szStocks = peFilter.filter(priceFilter.filter(StockPool.getInstance().allSZStocks)); stocks.AddRange(shStocks); stocks.AddRange(szStocks); StockListFileUtil.writeStocksToFile(stocks, filepath); }
private List <string> filterStocksByPriceScale_PE_Eps(List <string> src, double ratio, double pe, double epsChg) { List <string> lowStocks = null; if (!m_useIntermediate) { PriceScaleFilter psFilter = new PriceScaleFilter(ratio); lowStocks = psFilter.filter(src); } else { lowStocks = src; } PEFilter peFilter = new PEFilter(pe); STFilter stFilter = new STFilter(); IndustryExcludeFilter indFilter = new IndustryExcludeFilter(); EPSPerfFilter epsFilter = new EPSPerfFilter(epsChg); return(epsFilter.filter(peFilter.filter(indFilter.filter(stFilter.filter(lowStocks))))); }
private List <string> filterStocksByCostPerf_PricePos_PE(List <string> src, string year, string quarter, double costDiffRatio, double priceRatio, double pe) { PEFilter peFilter = new PEFilter(pe); STFilter stFilter = new STFilter(); IndustryExcludeFilter indFilter = new IndustryExcludeFilter(); CostPerfFilter cpFilter = new CostPerfFilter(year, quarter, costDiffRatio); PriceScaleFilter psFilter = new PriceScaleFilter(priceRatio); Logger.log("Start filter ...."); List <string> f1Result = indFilter.filter(stFilter.filter(src)); Logger.log("Basic filter, count: " + f1Result.Count.ToString()); List <string> f2Result = peFilter.filter(f1Result); Logger.log("PE filter, count: " + f2Result.Count.ToString()); List <string> f3Result = cpFilter.filter(f2Result); Logger.log("Cost filter, count: " + f3Result.Count.ToString()); List <string> f4Result = psFilter.filter(f3Result); Logger.log("Price Pos filter, count: " + f4Result.Count.ToString()); return(f4Result); }