Exemple #1
0
        Dictionary <String, String> IStrategy.select(DataStoreHelper dsh, SelectMode selectMode, ref String sigInfo)
        {
            var zf = dsh.Ref(Info.ZF);

            if (zf > 0.095 || zf < -0.095)
            {
                return(null);
            }
            if (zf < 0.01)
            {
                return(null);
            }
            if (dsh.IsLikeSTStop())
            {
                return(null);
            }
            var szZF = dsh.SZRef(Info.ZF);

            if (szZF < 0.01)
            {
                return(null);
            }
            if (szZF < 0.011 && dsh.SZAcc(Info.ZF, 7, 1) > 0.03)
            {
                return(null);
            }
            var recentMaxSZZF = dsh.SZRef(Info.ZF, dsh.SZHH(Info.ZF, 10, 1));

            if (recentMaxSZZF < 0.005)
            {
                return(null);
            }
            var minSZZFIndex = dsh.SZLL(Info.ZF, 8, 1);

            if (dsh.SZRef(Info.ZF, minSZZFIndex) > -0.005)
            {
                return(null);
            }


            if (!dsh.IsReal())
            {
                return(null);
            }
            if (dsh.UpShadow() > 0.04)
            {
                return(null);
            }
            if (dsh.DownShadow() < -0.04)
            {
                return(null);
            }
            var of = dsh.Ref(Info.OF);

            if (of > 0.02 || of < -0.04)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 1) > -0.02 || dsh.Ref(Info.ZF, 1) < -0.095)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 2) < -0.02)
            {
                return(null);
            }
            if (zf + dsh.Ref(Info.ZF, 1) < 0)
            {
                return(null);
            }
            if (dsh.Ref(Info.V) > dsh.Ref(Info.V, 1) * 1.5)
            {
                return(null);
            }
            for (int i = 1; i < 8; ++i)
            {
                var curZF = dsh.Ref(Info.ZF, i);
                var curOf = dsh.Ref(Info.OF, i);
                if (curOf > 0.04 && curZF < 0)
                {
                    return(null);
                }
                if (curOf < -0.02 && curZF < 0)
                {
                    return(null);
                }
            }
            if (dsh.AccZF(8, 1) < -0.1)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, dsh.HH(Info.CO, 10)) > 0)
            {
                return(null);
            }
            int iMaxVolIndex = dsh.HH(Info.V, 10);

            if (dsh.Ref(Info.C, iMaxVolIndex) > dsh.Ref(Info.O, iMaxVolIndex))
            {
                return(null);
            }
            if ((dsh.Ref(Info.H, dsh.HH(Info.H, 8)) - dsh.Ref(Info.L, dsh.LL(Info.L, 8))) / dsh.Ref(Info.C, 1) > 0.2)
            {
                return(null);
            }
            return(EmptyRateItemButSel);
        }
Exemple #2
0
        public virtual Dictionary <String, String> selectFor(DataStoreHelper dsh, SelectMode selectMode, ref String sigInfo)
        {
            var zf = dsh.Ref(Info.ZF);

            if (zf > 0.095 || zf < -0.095)
            {
                return(null);
            }
            if (zf < 0.02)
            {
                return(null);
            }
            if (dsh.IsLikeSTStop())
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 2) < 0.03)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 1) > -0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 3) > 0)
            {
                return(null);
            }
            if (dsh.AccZF(3) < 0.05)
            {
                return(null);
            }
            if (dsh.AccZF(3, 3) > 0)
            {
                return(null);
            }
            if (dsh.Ref(Info.V) > dsh.Ref(Info.V, 1) * 2)
            {
                return(null);
            }
            for (int i = 0; i < 4; ++i)
            {
                if (dsh.DownShadow(i) < -0.04)
                {
                    return(null);
                }
                if ((dsh.Ref(Info.CO, i) / dsh.Ref(Info.C, i + 1)) < 0.005)
                {
                    return(null);
                }
                if (dsh.Ref(Info.OF, i) > 0.02 && dsh.Ref(Info.ZF, i) < -0.02)
                {
                    return(null);
                }
            }
            var hhCO = dsh.HH(Info.CO, 8);

            if (dsh.Ref(Info.ZF, hhCO) > 0)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, dsh.LL(Info.ZF, 8)) < -0.095)
            {
                return(null);
            }
            if (dsh.HH(Info.V, 6) == 0)
            {
                return(null);
            }

            return(EmptyRateItemButSel);
        }
Exemple #3
0
        Dictionary <String, String> IStrategy.select(DataStoreHelper dsh, SelectMode selectMode, ref String sigInfo)
        {
            IStrategy_LF_M stra       = (IStrategy_LF_M)this;
            int            nowMiniute = Utils.NowMinute();

            if (nowMiniute < 60)
            {
                return(null);
            }
            if (dsh.stock_.name_.ToUpper().IndexOf("ST") != -1)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, dsh.HH(Info.ZF, 10)) > 0.095)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, dsh.LL(Info.ZF, 10)) < -0.095)
            {
                return(null);
            }
            var hf = dsh.Ref(Info.HF);

            if (hf > 0.05 || hf < 0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.LF) < -0.06)
            {
                return(null);
            }

            var lastDayC = dsh.Ref(Info.C, 1);
            var gllc     = dsh.Ref(Info.L);
            var ghhc     = dsh.Ref(Info.H);
            var c        = dsh.Ref(Info.C);
            var o        = dsh.Ref(Info.O);

            if (c >= lastDayC)
            {
                return(null);
            }

            if (ghhc <= lastDayC)
            {
                return(null);
            }
            var rsh = dsh.newRuntimeDsh();

            var c5 = rsh.Ref(Info.C, 5);

            if ((c - c5) / lastDayC > -0.01)
            {
                return(null);
            }
            var c10 = rsh.Ref(Info.C, 10);

            if ((c - c10) / lastDayC > -0.015)
            {
                return(null);
            }
            var c15 = rsh.Ref(Info.C, 15);

            if ((c - c15) / lastDayC > -0.02)
            {
                return(null);
            }
            var c20 = rsh.Ref(Info.C, 20);

            if ((c - c20) / lastDayC < -0.025)
            {
                return(null);
            }
            var c25 = rsh.Ref(Info.C, 25);

            if ((c - c25) / lastDayC < -0.03)
            {
                return(null);
            }
            var c30 = rsh.Ref(Info.C, 30);

            if ((c - c30) / lastDayC > -0.035)
            {
                return(null);
            }

            return(EmptyRateItemButSel);
        }