Example #1
0
        public override bool CheckEnableOut()
        {
            double minRate = (double)this.ChipCount / this.CommSetting.Odds;
            //double midRate = (double)this.ChipCount / 10;
            //double maxRate = 2 * midRate - minRate;
            double lastVal = this.RateDic[this.LastUseData().LastData.Expect];

            //进行布林线验证
            Bull bull = null;

            double[][] res = null;
            if (!this.UseMainGuides().ContainsKey(this.LastUseData().LastData.Expect))
            {
                bull = new Bull(this.RateDic.Values.ToArray <double>(), 20);
                res  = bull.getLastData();
                this.UseMainGuides().Add(this.LastUseData().LastData.Expect, bull);
            }
            else
            {
                bull = this.UseMainGuides()[this.LastUseData().LastData.Expect] as Bull;
                res  = bull.BuffData;
            }
            if (lastVal > 100 * minRate) //如果大于保本的最小值,返回真
            {
                return(true);
            }

            int bullCnt = res[0].Length;

            if (lastVal > res[1][bullCnt - 1])//当前值上穿上布林线,出场
            {
                return(true);
            }
            return(false);
        }
Example #2
0
        public override bool CheckEnableIn()
        {
            double minRate = (double)this.ChipCount / this.CommSetting.Odds;
            double midRate = (double)this.ChipCount / 10;
            double maxRate = 2 * midRate - minRate;
            double lastVal = this.RateDic[this.LastUseData().LastData.Expect];

            if (this.RateDic.Count == 1)
            {
                return(false);
            }
            double preval = this.RateDic[string.Format("{0}", Int32.Parse(this.LastUseData().LastData.Expect) - 1)];
            //布林线验证
            Bull bull = null;

            double[][] res    = null;
            double[][] preres = null;
            if (this.UseMainGuides() == null || !this.UseMainGuides().ContainsKey(this.LastUseData().LastData.Expect))
            {
                bull   = new Bull(this.RateDic.Values.ToArray <double>(), 20);
                res    = bull.getLastData();
                preres = bull.Ref(1);
                if (this.UseMainGuides() == null)
                {
                    this.SetUseMainGuides(new Dictionary <string, MGuide>());
                }
                this.UseMainGuides().Add(this.LastUseData().LastData.Expect, bull);
            }
            else
            {
                bull   = this.UseMainGuides()[this.LastUseData().LastData.Expect] as Bull;
                res    = bull.getLastData();
                preres = bull.Ref(1);
            }

            if (lastVal > 100 * maxRate) //如果大于允许进入的最大值,返回否
            {
                return(false);
            }

            int bullCnt = res[0].Length;

            if (lastVal > res[2][0] && preval < preres[2][0])//当前值上穿下布林线,入场
            {
                return(true);
            }
            return(false);
        }