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.02 || zf > 0.03)
            {
                return(null);
            }
            if (dsh.IsLikeSTStop())
            {
                return(null);
            }
            if (dsh.Ref(Info.OF) < -0.015)
            {
                return(null);
            }
            if (dsh.EveryDown(1) >= 3)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 1) > -0.02 || dsh.Ref(Info.ZF, 1) < -0.05)
            {
                return(null);
            }
            if (dsh.UpShadow() > 0.04)
            {
                return(null);
            }
            if (dsh.Ref(Info.CO) / dsh.Ref(Info.C, 1) < 0.01)
            {
                return(null);
            }
            if (dsh.AccZF(8) > -0.1)
            {
                return(null);
            }
            if (dsh.AccZF(2) > 0)
            {
                return(null);
            }
            if (dsh.HH(Info.V, 8) == 0)
            {
                return(null);
            }
            if (dsh.DownShadow() < -0.04)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, 2) < -0.01)
            {
                return(null);
            }
            if (!dsh.IsReal())
            {
                return(null);
            }

            for (int i = 1; i < 8; ++i)
            {
                var curZF = dsh.Ref(Info.ZF, i);
                var curOF = dsh.Ref(Info.OF, i);
                if (curZF < -0.095 || curZF > 0.095)
                {
                    return(null);
                }
                if (curOF > 0.04 && dsh.IsGreen(i))
                {
                    return(null);
                }
                if (dsh.IsUpStopEveryDay(3, i))
                {
                    return(null);
                }
            }
            if (!selectBySZ(dsh))
            {
                return(null);
            }

            return(EmptyRateItemButSel);
        }
Exemple #2
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);
            }
            if (dsh.DownShadow() < -0.04)
            {
                return(null);
            }

            if ((dsh.Ref(Info.C, 1) - dsh.Ref(Info.L, 3)) / dsh.Ref(Info.C, 1) > 0)
            {
                return(null);
            }
            if (dsh.Ref(Info.HL, 1) > dsh.Ref(Info.HL, 2) * 2)
            {
                return(null);
            }
            if (dsh.Ref(Info.HL, 2) > dsh.Ref(Info.HL, 1) * 2)
            {
                return(null);
            }
            if (dsh.Ref(Info.C) < dsh.Ref(Info.O, 1))
            {
                return(null);
            }
            if ((dsh.Ref(Info.C, 1) - dsh.Ref(Info.O, 5)) / dsh.Ref(Info.C, 1) > 0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.L) < dsh.Ref(Info.L, 1) && dsh.Ref(Info.H) > dsh.Ref(Info.H, 1))
            {
                return(null);
            }

            if (dsh.AccZF(2, 1) < -0.1)
            {
                return(null);
            }
            if (dsh.AccZF(3) > 0.02)
            {
                return(null);
            }
            if (dsh.AccZF(2) < -0.04)
            {
                return(null);
            }
            var accZF6 = dsh.AccZF(6);

            if (accZF6 > 0.08)
            {
                return(null);
            }
            int nDownCount = 2;

            if (dsh.EveryDown(1) != nDownCount)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, nDownCount + 1) < 0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, dsh.HH(Info.ZF, 6)) < 0.03)
            {
                return(null);
            }

            if (dsh.Ref(Info.ZF, nDownCount + 2) > -0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.ZF, nDownCount + 3) < 0.01)
            {
                return(null);
            }
            var upV   = dsh.Acc(Info.V, 6, 0, 1);
            var downV = dsh.Acc(Info.V, 6, 0, -1);

            if (upV > downV * 1.5)
            {
                return(null);
            }

            for (int i = 0; i <= 5; ++i)
            {
                var curOF = dsh.Ref(Info.OF, i);
                var curZF = dsh.Ref(Info.ZF, i);
                if (!dsh.IsReal(i))
                {
                    return(null);
                }
                if (curZF > 0.095 || curZF < -0.095)
                {
                    return(null);
                }
                if (curOF > 0.02 && curZF < 0)
                {
                    return(null);
                }
                if (curOF < -0.02 && curZF < 0)
                {
                    return(null);
                }
                if (dsh.Ref(Info.CO, i) / dsh.Ref(Info.C, i + 1) < 0.006)
                {
                    return(null);
                }
            }
            var szZF = dsh.SZRef(Info.ZF);

            if (szZF > 0 && szZF < 0.011 && dsh.SZAcc(Info.ZF, 7, 1) > 0.03)
            {
                return(null);
            }
            if (!selectBySZ(dsh))
            {
                return(null);
            }
            return(EmptyRateItemButSel);
        }
        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.03 || zf < 0.02)
            {
                return(null);
            }
            if (!dsh.IsReal())
            {
                return(null);
            }
            if (dsh.UpShadow() > 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.005)
            {
                return(null);
            }

            if (dsh.Ref(Info.ZF, 2) < 0.005 || !dsh.IsReal(2))
            {
                return(null);
            }
            if (dsh.Ref(Info.V) > dsh.Ref(Info.V, 1) * 1.5)
            {
                return(null);
            }
            if ((dsh.Ref(Info.C) - dsh.Ref(Info.C, 2)) / dsh.Ref(Info.C, 1) > 0.01)
            {
                return(null);
            }
            if (dsh.Ref(Info.C) > dsh.Ref(Info.O, 1))
            {
                return(null);
            }
            if ((dsh.Ref(Info.L) - dsh.Ref(Info.L, 2)) / dsh.Ref(Info.C, 1) > 0.01)
            {
                return(null);
            }
            int nTotalDownDays = dsh.EveryDown(3);

            if (nTotalDownDays < 4)
            {
                return(null);
            }
            if (dsh.EveryUp(3 + nTotalDownDays) > nTotalDownDays)
            {
                return(null);
            }
            float totalZF = dsh.AccZF(nTotalDownDays, 3);

            if (totalZF > -0.1)
            {
                return(null);
            }
            var szZF = dsh.SZRef(Info.ZF);

            if (szZF > 0 && szZF < 0.011 && dsh.SZAcc(Info.ZF, 7, 1) > 0.03)
            {
                return(null);
            }
            if (!selectBySZ(dsh))
            {
                return(null);
            }
            return(EmptyRateItemButSel);
        }