Example #1
0
        public virtual CanBePayPoint FindPayPoint()
        {
            List <CanBePayPoint> payPoints = new List <CanBePayPoint>();
            var an = this.GenerateAmountResult(1, 1, 1, 1, BetModel.KillTowNo, 1);

            for (var i = 0; i <= an.Count - 1; i++)
            {
                int wincount    = 0;
                int failedcount = 0;
                int passcount   = 0;
                for (var j = i; j <= an.Count - 1; j++)
                {
                    passcount++;
                    if (an[j].Status == "中奖")
                    {
                        wincount++;
                    }
                    else
                    {
                        failedcount++;
                    }
                    var x = (455 - wincount) * 0.16464;
                    var y = 0.056 * (1440 - passcount);
                    if (x - y > 0)
                    {
                        CanBePayPoint p = new CanBePayPoint();
                        p.StartIssueId = an[i].IssueId;
                        p.RestPayCount = 1440 - passcount;
                        p.PayIssueId   = an[j].IssueId;
                        p.PassCount    = passcount;
                        p.WinCount     = wincount;
                        if (an[j].IssueId == an[an.Count - 1].IssueId)
                        {
                            payPoints.Add(p);
                        }

                        break;
                    }
                }
            }
            payPoints = payPoints.OrderByDescending(r => r.StartIssueId).ToList();
            if (payPoints.Count > 0)
            {
                return(payPoints[0]);
            }
            return(null);
        }
Example #2
0
        public override List <CanBePayPoint> FindPayPoints(int splitNum = 455)
        {
            List <CanBePayPoint> payPoints = new List <CanBePayPoint>();
            var an = this.GenerateAmountResult(1, 1, 1, 1, BetModel.KillTowNo, 1);

            for (var i = 0; i <= an.Count - 1; i++)
            {
                int wincount    = 0;
                int failedcount = 0;
                int passcount   = 0;
                for (var j = i; j <= an.Count - 1; j++)
                {
                    passcount++;
                    if (an[j].Status == "中奖")
                    {
                        wincount++;
                    }
                    else
                    {
                        failedcount++;
                    }
                    var x = (splitNum - wincount) * 0.16464;
                    var y = 0.056 * (1440 - passcount);
                    if (x - y > 0)
                    {
                        CanBePayPoint p = new CanBePayPoint();
                        p.StartIssueId = an[i].IssueId;
                        p.StartDate    = an[i].RewardDate;
                        p.RestPayCount = 1440 - passcount;
                        p.PayIssueId   = an[j].IssueId;
                        p.PayDate      = an[j].RewardDate;
                        p.PassCount    = passcount;
                        p.WinCount     = wincount;
                        if (p.RestPayCount >= 240)
                        {
                            payPoints.Add(p);
                            break;
                        }
                    }
                }
            }
            payPoints = payPoints.OrderByDescending(r => r.StartIssueId).ToList();
            return(payPoints);
        }
Example #3
0
        public override List <CanBePayPoint> FindPayPoints(int lastNumber = 240, double payRate = 0.83)
        {
            //return base.FindPayPoints(lastNumber, payRate);
            List <CanBePayPoint> payPoints = new List <CanBePayPoint>();
            var an = this.GenerateAmountResult(1, 1, 1, 1, BetModel.KillTowNo, 1);

            for (var i = 0; i <= an.Count - (lastNumber + 1); i++)
            {
                double cycleWinNum    = 0;
                double cycleTotalNum  = 0;
                double cycleFailedNum = 0;
                for (var j = i; j < lastNumber + i; j++)
                {
                    var item = an[j];
                    if (item.Status == "中奖")
                    {
                        cycleWinNum++;
                        cycleTotalNum++;
                    }
                    else if (item.Status == "未中奖" && item.CirCleNum == 3)
                    {
                        cycleFailedNum++;
                        cycleTotalNum++;
                    }
                }
                if ((cycleWinNum / cycleTotalNum) <= payRate)
                {
                    //一天只取一个
                    bool isExist = false;
                    foreach (var existItem in payPoints)
                    {
                        if (an[lastNumber + i].CreatedOn.Month == existItem.StartDateTime.Month &&
                            an[lastNumber + i].CreatedOn.Date == existItem.StartDateTime.Date)
                        {
                            isExist = true;
                        }
                    }
                    if (!isExist)
                    {
                        CanBePayPoint cpp = new CanBePayPoint();
                        cpp.PayIssueId    = an[lastNumber + i].IssueId;
                        cpp.WinRate       = (cycleWinNum / cycleTotalNum);
                        cpp.WinCount      = (int)cycleWinNum;
                        cpp.PassCount     = (int)cycleTotalNum;
                        cpp.StartDateTime = an[lastNumber + i].CreatedOn;
                        payPoints.Add(cpp);
                    }
                }
            }

            //根据接下来的一天下单情况,算出是否盈利
            foreach (var item in payPoints)
            {
                LotteryBusiness lb            = new LotteryBusiness();
                double          balance       = 1000;
                double          maxLowBalance = 10000000;
                this.History = lb.GetLoRecordsByDate(item.StartDateTime.AddMinutes(-KillUsedIssueCount), item.StartDateTime.AddDays(1));
                var an2 = this.GenerateAmountResult(1, 1, 1, 1, BetModel.KillTowNo, 1);
                for (var j = 0; j < an2.Count; j++)
                {
                    var item2 = an2[j];
                    if (item2.Status == "中奖")
                    {
                        balance = balance + 4.85;
                    }
                    else if (item2.Status == "未中奖" && item2.CirCleNum == 3)
                    {
                        balance = balance - 38.4;
                    }
                    if (maxLowBalance > balance)
                    {
                        maxLowBalance = balance;
                    }
                    if (balance <= 0)
                    {
                        item.IsWin       = "亏";
                        item.EndDateTime = item2.CreatedOn;

                        break;
                    }
                    if (balance >= 1150)
                    {
                        item.IsWin       = "盈";
                        item.EndDateTime = item2.CreatedOn;
                        break;
                    }
                }
                item.Balance    = balance;
                item.MaxBalance = maxLowBalance;
            }

            return(payPoints);
        }