예제 #1
0
        public List <string> screen()
        {
            List <string> src = StockPool.getInstance().getAllStocks();

            STFilter stFlt = new STFilter();
            IndustryExcludeFilter indFlt = new IndustryExcludeFilter();
            KLinePatternFilter    osFlt  = new KLinePatternFilter(new Oversold2Day());
            PriceScaleFilter      psFlt  = new PriceScaleFilter(0.5);
            List <string>         stocks = psFlt.filter(osFlt.filter(indFlt.filter(stFlt.filter(src))));

            return(stocks);
        }
예제 #2
0
        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)))));
        }
예제 #3
0
        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);
        }
예제 #4
0
        public IStockFilter generateFilter()
        {
            IStockFilter filter  = null;
            string       year    = GlobalConfig.getInstance().curYear;
            string       quarter = GlobalConfig.getInstance().curQuarter;

            switch (m_type)
            {
            case AppFilterType.FLTT_Cost:
                filter = generateCostFilter();
                break;

            case AppFilterType.FLTT_PE:
                filter = generatePEFilter();
                break;

            case AppFilterType.FLTT_InIndustry:
                filter = generateInIndustryFilter();
                break;

            case AppFilterType.FLTT_PriceScale:
                filter = new PriceScaleFilter(m_param1);
                break;

            case AppFilterType.FLTT_Distrib:
                filter = new DistribBonusFilter(year, quarter, m_param1);
                break;

            case AppFilterType.FLTT_ExcludeIndustry:
                filter = new IndustryExcludeFilter();
                break;

            case AppFilterType.FLTT_STStocks:
                filter = new STFilter();
                break;

            case AppFilterType.FLTT_ROE:
                filter = new ROESustainedFilter(year, quarter, m_param1, int.Parse(m_param2));
                break;

            case AppFilterType.FLTT_NetProfitRatio:
                filter = new NetProfitRatioSustainedFilter(year, quarter, m_param1, int.Parse(m_param2));
                break;

            case AppFilterType.FLTT_IncludeIndustry:
                string[]      arr        = m_param2.Split(';');
                List <string> industries = new List <string>();
                industries.AddRange(arr);
                filter = new IndustryIncludeFilter(industries);
                break;

            case AppFilterType.FLTT_HolderCount:
                filter = generateHolderCountFilter();
                break;

            case AppFilterType.FLTT_StableProfit:
                int yearsCount = int.Parse(m_param2);
                filter = new QuarterNetProfitFilter(year, quarter, yearsCount, 0.1);
                // AnnualNetProfitFilter(year, quarter, yearsCount, 0.1);
                break;

            case AppFilterType.FLTT_Amplitude:
                int daysCount = int.Parse(m_param2);
                filter = new AvgAmplitudeFilter(m_param1, daysCount);
                break;

            case AppFilterType.FLTT_SubNew:
                filter = new SubNewFilter();
                break;

            case AppFilterType.FLTT_PBCost:
                filter = new AnnualPBCostFilter(year, quarter, m_param1);
                break;

            case AppFilterType.FLTT_BlackList:
                filter = new BlackListFilter();
                break;

            default:
                break;
            }

            return(filter);
        }