Exemplo n.º 1
0
        public override bool AddOrder(IPlatForm pf, List <DB_PredictRecord> last30Records,
                                      string model = "li", int mul = 1)
        {
            //return base.AddOrder(pf, last30Records);

            var selectNum = "";
            var killno1   = this.KillNo1;
            var killno2   = this.KillNo2;

            if (string.IsNullOrEmpty(killno1) && string.IsNullOrEmpty(killno2))
            {
                DB_PredictRecord dr = new DB_PredictRecord();
                var nums            = this.GetTwoKillNo(last30Records.Count, last30Records, ref dr);
                killno1 = nums[0];
                killno2 = nums[1];
            }
            for (var i = 0; i <= 9; i++)
            {
                if (i.ToString() != killno1 && i.ToString() != killno2)
                {
                    if (selectNum.Length != 14)
                    {
                        selectNum += i.ToString() + ",";
                    }
                    else
                    {
                        selectNum += i.ToString();
                    }
                }
            }
            var flag = pf.MakeOrder(model, mul, selectNum, pf.GetMiddleKillTwoMethodName());

            return(flag);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据模式判断
        /// 判断逻辑,有且只有一个对子,不能有3个的,4 个的,5个的。就是中奖
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public bool IsWinByModeKillNo(DB_PredictRecord record, BetModel model, string killNo)
        {
            bool win = false;

            if (OnlyPairModelBet(record.GoodNo) && !record.GoodNo.Contains(killNo))
            {
                win = true;
            }

            return(win);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据模式判断
        /// 判断逻辑,有且只有一个对子,不能有3个的,4 个的,5个的。就是中奖
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public bool IsWinByMode(DB_PredictRecord record, BetModel model)
        {
            bool win = false;

            if (OnlyPairModelBet(record.GoodNo))
            {
                win = true;
            }


            return(win);
        }
Exemplo n.º 4
0
        public override List <DB_PredictRecord> GenerateAmountResult(double balance, double firstBet, int chaseNum, double benifitRate, BetModel model, double secondBenifitRate)
        {
            this.PayMoneys[0] = 5;
            this.PayMoneys[1] = 12;
            this.PayMoneys[2] = 27;
            List <DB_PredictRecord> betList = new List <DB_PredictRecord>();
            //3期为一个周期
            int count = 1;

            bool isStop = false;

            //前30期用来判断,下棋号码,不进行结果预测
            for (var i = KillUsedIssueCount; i < this.History.Count; i++)
            {
                DB_PredictRecord item = new DB_PredictRecord();
                item.GoodNo     = History[i].GoodNo;
                item.RewardDate = History[i].RewardDate;
                item.IssueId    = History[i].IssueId;
                item.CreatedOn  = History[i].CreatedOn;


                //if (IsWinByKillTwoNum(i, this.History, ref item)) {
                //    item.Status = "中奖";
                //} else {
                //    item.Status = "未中奖";
                //}

                if (IsWinByKillTwoNum_Individual(i, this.History, ref item))
                {
                    item.Status = "中奖";
                    count       = 1;
                }
                else
                {
                    item.Status    = "未中奖";
                    item.CirCleNum = count;
                    count++;
                }


                betList.Add(item);
            }
            return(betList);
        }
Exemplo n.º 5
0
        private List <DB_PredictRecord> ConvertToList(System.Data.DataTable table)
        {
            List <DB_PredictRecord> col = new List <DB_PredictRecord>();

            if (table.Rows.Count > 0)
            {
                for (var i = 0; i < table.Rows.Count; i++)
                {
                    DB_PredictRecord rd = new DB_PredictRecord();
                    rd.GoodNo     = table.Rows[i]["GoodNo"].ToString();
                    rd.IssueId    = table.Rows[i]["IssueId"].ToString();
                    rd.RewardDate = table.Rows[i]["RewardDate"].ToString();
                    rd.CreatedOn  = (DateTime)table.Rows[i]["CreatedOn"];
                    col.Add(rd);
                }
            }

            return(col);
        }
Exemplo n.º 6
0
        public override List <DB_PredictRecord> GenerateAmountResult(double balance, double firstBet, int chaseNum, double benifitRate, BetModel model, double secondBenifitRate)
        {
            List <DB_PredictRecord> betList = new List <DB_PredictRecord>();
            //追3期不中,停一期,计数器
            int preThreeCount = 0;
            //当前追的期,0为第一期
            int rateCount = 0;

            for (var i = 0; i < History.Count; i++)
            {
                if (model == BetModel.PairKlllCV1 || model == BetModel.PairKillCV2)
                {
                    if (i < 30)
                    {
                        i++;
                        continue;
                    }
                }
                DB_PredictRecord item = new DB_PredictRecord();
                item.GoodNo     = History[i].GoodNo;
                item.RewardDate = History[i].RewardDate;
                item.IssueId    = History[i].IssueId;
                //根据chaseNum 设置爆仓
                if (rateCount == chaseNum + 1)
                {
                    rateCount = 0;
                }
                //判断是否为前三期,前三期下注1.93*PayMoneys[stopCount]
                if (rateCount < 3)
                {
                    //下注前三期
                    item.PayAmount = PayMoneys[rateCount];
                    balance        = balance - item.PayAmount;
                    if (IsWinByMode(item, model))
                    {
                        item.Earn   = PayMoneys[rateCount] * benifitRate;
                        balance     = balance + item.Earn;
                        item.Status = "中奖";
                        rateCount   = 0;
                    }
                    else
                    {
                        rateCount   = rateCount + 1;
                        item.Status = "未中奖";
                    }
                    //item.Balance = balance;
                }
                //前三次未中奖
                else
                {
                    //判断上次是否中奖(是否出现对子),应该4次开始,如果上次中奖就下单
                    if (IsWinByMode(History[i - 1], model))
                    {
                        item.PayAmount = PayMoneys[rateCount];
                        balance        = balance - item.PayAmount;
                        item.Kill5No   = this.FindKillNumber(i, History); //i为要下注的那一期

                        if (IsWinByModeKillNo(History[i], model, item.Kill5No))
                        {
                            item.Earn = PayMoneys[rateCount] * secondBenifitRate;
                            balance   = balance + item.Earn;
                            rateCount = 0;
                        }
                        else
                        {
                            rateCount   = rateCount + 1;
                            item.Status = "未中奖";
                        }
                    }
                    else
                    {
                        item.Status = "未下单";
                    }
                }
                item.Balance = balance;
                betList.Add(item);
            }


            return(betList);
        }
Exemplo n.º 7
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            if (!_isLogin)
            {
                return;
            }
            timer2.Stop();

            var bal = this.GetBalance();

            if (bal == 0)
            {
                timer2.Start();
                return;
            }

            try
            {
                this.StopWin    = double.Parse(txtStopWin.Text);
                this.StopFailed = double.Parse(txtLossStop.Text);
            }
            catch (Exception ex) {
                LogHelper.ErrorLog("解析止损赢失败:" + ex.Message, ex);
            }

            //止损
            if ((bal - this.OriginBalance) >= this.StopWin)
            {
                Switch();
                return;
            }

            //止盈
            if ((this.OriginBalance - bal) >= this.StopFailed)
            {
                Switch();
                return;
            }

            //if (_goodPoint != null && _goodPoint.RestPayCount <= 0)
            //{
            //    Switch();
            //    _goodPoint = OnlyKill2Model.FindPayPoint();
            //    if (_goodPoint != null)
            //    {
            //        lblstopissue.Text = _goodPoint.StopIssueId;
            //    }
            //    else
            //    {
            //        //lblstopissue.Text = "-";
            //    }

            //}



            if (label1.Visible == true)
            {
                if (lastRecord != null)
                {
                    var subRecords = records.Select(r => r).Where(r => r.IssueId == lastRecord.CP_QS).ToList();
                    if (subRecords.Count > 0)
                    {
                        subRecords[0].GoodNo     = lastRecord.ZJHM;
                        subRecords[0].RewardDate = lastRecord.SJKJSJ;

                        var sub = lastRecord.ZJHM;
                        if (!OnlyKill2Model.CheckWin(subRecords[0].Kill3No, subRecords[0].Kill5No, sub))
                        {
                            subRecords[0].Status = "未中奖";

                            UpdateFailed(subRecords[0].GoodNo);

                            UpdatePayMoneyAndChase(lastRecord.CP_QS, subRecords[0].IsPay);
                            //if (subRecords[0].IsPay == "未下单") {
                            //    WatcingFailedCount++;
                            //}
                        }
                        else
                        {
                            subRecords[0].Status = "中奖";
                            chaseCount           = 1;


                            subRecords[0].Earn = subRecords[0].PayAmount * 1.9296;
                            UpdateWin(subRecords[0].GoodNo);

                            if (subRecords[0].IsPay == "未下单")
                            {
                                WatcingFailedCount = 0;
                            }
                        }
                    }
                }

                var subRecords2 = records.Select(r => r).Where(r => r.IssueId == predictNum).ToList();
                if (subRecords2.Count == 0)
                {
                    var payItem = new DB_PredictRecord();
                    payItem.GoodNo  = "";
                    payItem.IssueId = predictNum;
                    payItem.Status  = "未开奖";
                    payItem.IsPay   = "未下单";
                    payItem.Kill3No = label2.Text;
                    payItem.Kill5No = label3.Text;

                    try
                    {
                        //if (IsAutoPay && _goodPoint!= null && _goodPoint.RestPayCount > 0) {
                        //    int mul = int.Parse(this.comboBox1.SelectedItem.ToString());
                        //    var bill = PayQQBill("li", mul, this.label6.Text);
                        //    payItem.PayAmount = QQMoneys[1]*mul;
                        //    payItem.IsPay = "已下单";
                        //    payItem.Balance = this.GetBalance();
                        //    lblBalance.Text = payItem.Balance.ToString();
                        //    PayCount = PayCount + 1;
                        //    lblpaytotal.Text = PayCount.ToString();
                        //    lblflow.Text = (PayCount * payItem.PayAmount).ToString();
                        //    _goodPoint.RestPayCount = _goodPoint.RestPayCount - 1;
                        //    lblRestPayCount.Text = _goodPoint.RestPayCount.ToString();
                        //}
                        if (rdoYesW.Checked == true)
                        {
                            if (IsAutoPay && IsBellow)
                            {
                                //int mul = int.Parse(this.comboBox1.SelectedItem.ToString());
                                int mul  = PayMultily[chaseCount];
                                var bill = PayQQBill("li", mul, this.label6.Text);
                                records.Add(payItem);
                                payItem.PayAmount = QQMoneys[1] * mul;
                                payItem.IsPay     = "已下单";
                                payItem.Balance   = this.GetBalance();
                                lblBalance.Text   = payItem.Balance.ToString();
                                PayCount          = PayCount + 1;
                                lblpaytotal.Text  = PayCount.ToString();
                                //lblflow.Text = (PayCount * payItem.PayAmount).ToString();
                                //_goodPoint.RestPayCount = _goodPoint.RestPayCount - 1;
                                // lblRestPayCount.Text = _goodPoint.RestPayCount.ToString();
                            }
                        }
                        else
                        {
                            if (IsAutoPay)
                            {
                                //int mul = int.Parse(this.comboBox1.SelectedItem.ToString());
                                int mul  = PayMultily[chaseCount];
                                var bill = PayQQBill("li", mul, this.label6.Text);

                                payItem.PayAmount = QQMoneys[1] * mul;
                                payItem.IsPay     = "已下单";
                                payItem.Balance   = this.GetBalance();
                                lblBalance.Text   = payItem.Balance.ToString();
                                PayCount          = PayCount + 1;
                                lblpaytotal.Text  = PayCount.ToString();
                                //lblflow.Text = (PayCount * payItem.PayAmount).ToString();
                                //_goodPoint.RestPayCount = _goodPoint.RestPayCount - 1;
                                // lblRestPayCount.Text = _goodPoint.RestPayCount.ToString();
                            }
                        }

                        records.Add(payItem);
                    }
                    catch (Exception ex)
                    {
                        chaseCount    = 1;
                        failedCount   = 0;
                        payItem.IsPay = "网站出问题,下单失败";
                        LogHelper.ErrorLog(DateTime.Now.ToString() + " -- 下单失败  -- " + ex.Message, ex);
                    }
                }

                List <DB_PredictRecord> newRecords = new List <DB_PredictRecord>();
                for (var j = records.Count - 1; j >= 0; j--)
                {
                    newRecords.Add(records[j]);
                }

                for (var j = 0; j < newRecords.Count; j++)
                {
                    bool exsit = false;
                    for (var i = 0; i < this.dataGridView2.Rows.Count; i++)
                    {
                        if (this.dataGridView2.Rows[i].Cells[0].Value.ToString() == newRecords[j].IssueId.ToString())
                        {
                            exsit = true;
                            this.dataGridView2.Rows[i].Cells["goodNo"].Value  = newRecords[j].GoodNo;
                            this.dataGridView2.Rows[i].Cells["status"].Value  = newRecords[j].Status;
                            this.dataGridView2.Rows[i].Cells["ispay"].Value   = newRecords[j].IsPay;
                            this.dataGridView2.Rows[i].Cells["pay"].Value     = newRecords[j].PayAmount;
                            this.dataGridView2.Rows[i].Cells["earn"].Value    = newRecords[j].Earn;
                            this.dataGridView2.Rows[i].Cells["balance"].Value = newRecords[j].Balance;
                        }
                    }
                    if (!exsit)
                    {
                        int index = this.dataGridView2.Rows.Add();
                        this.dataGridView2.Rows[index].Cells[0].Value         = newRecords[0].IssueId;
                        this.dataGridView2.Rows[index].Cells[1].Value         = newRecords[0].GoodNo;
                        this.dataGridView2.Rows[index].Cells[2].Value         = newRecords[0].Status;
                        this.dataGridView2.Rows[index].Cells[3].Value         = newRecords[0].IsPay;
                        this.dataGridView2.Rows[index].Cells["killno1"].Value = newRecords[0].Kill3No;
                        this.dataGridView2.Rows[index].Cells["killno2"].Value = newRecords[0].Kill5No;
                    }
                }



                for (var i = 0; i < this.dataGridView2.Rows.Count; i++)
                {
                    if (this.dataGridView2.Rows[i].Cells["status"].Value.ToString() == "中奖")
                    {
                        this.dataGridView2.Rows[i].Cells["status"].Style.BackColor = Color.Green;
                    }
                    else
                    {
                        this.dataGridView2.Rows[i].Cells["status"].Style.BackColor = Color.Red;
                    }

                    if (this.dataGridView2.Rows[i].Cells["ispay"].Value.ToString() == "未下单")
                    {
                        this.dataGridView2.Rows[i].Cells["ispay"].Style.BackColor = Color.Yellow;
                    }
                }
            }

            timer2.Start();
        }
Exemplo n.º 8
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!_isLogin)
            {
                return;
            }

            timer1.Stop();

            //刷新计算下单点
            //var his = _lb.GetLastRecordsByPage();
            //his = his.OrderBy(r => r.IssueId).ToList();
            //OnlyKill2Model.History = his;
            //if (_goodPoint == null)
            //{
            //    _goodPoint = OnlyKill2Model.FindPayPoint();
            //    if (_goodPoint != null)
            //    {
            //        lblstopissue.Text = _goodPoint.StopIssueId;
            //        lblRestPayCount.Text = _goodPoint.RestPayCount.ToString();
            //        this.Switch();
            //    }
            //}
            if (IsArriveWinPoint)
            {
                IsArriveWinPoint = false;
                refreshStatus();
            }
            IsBelowPayRate();

            var lottery_id = 10014;

            try
            {
                var             res         = Util.getURLResponseStr(minjueQQMinURL, _cookie, minjuePost);
                List <LISTItem> lotteryRlts = new List <LISTItem>();
                var             qqrlt       = JsonConvert.DeserializeObject <Res_QQminResult>(res);
                foreach (var qqItem in qqrlt.data.result)
                {
                    System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
                    DateTime        dt        = startTime.AddMilliseconds(qqItem.openTime);
                    lotteryRlts.Add(new LISTItem
                    {
                        CP_ID  = "腾讯分分彩",
                        CP_QS  = qqItem.issue,
                        ZJHM   = qqItem.code,
                        SJKJSJ = dt.ToString("yyyyMMdd hh:mm:ss"),
                        KJSJ   = dt.ToString("yyyyMMdd hh:mm:ss")
                    });
                }


                this.dataGridView1.DataSource = lotteryRlts;
                this.dataGridView1.Columns[0].HeaderCell.Value = "开奖号码";
                this.dataGridView1.Columns[1].HeaderCell.Value = "期号";
                this.dataGridView1.Columns[2].HeaderCell.Value = "开奖时间";
                this.dataGridView1.Columns[3].HeaderCell.Value = "实际开奖时间";
                this.dataGridView1.Columns[4].HeaderCell.Value = "彩票类型ID";


                DB_PredictRecord dr = new DB_PredictRecord();
                var dblist          = this.Convert(qqrlt.data.result);
                dblist.Add(new DB_PredictRecord()
                {
                });
                var nums = OnlyKill2Model.GetTwoKillNo_Individual(dblist.Count - 1, dblist);//Util.PredictResult(lotteryRlts);

                foreach (var item in lotteryRlts)
                {
                    if (item.CP_QS == predictNum)
                    {
                        lastRecord = item;
                    }
                }
                var afterspli = lotteryRlts[0].CP_QS.Split(new char[] { '-' });
                var seq       = afterspli[0] + afterspli[1];
                predictNum = (Int64.Parse(seq) + 1).ToString();

                if (predictNum.Contains("1440"))
                {
                    DateTime date = DateTime.Parse(lotteryRlts[0].CP_QS.Substring(0, 4) + "-" + lotteryRlts[0].CP_QS.Substring(4, 2) + "-" + lotteryRlts[0].CP_QS.Substring(6, 2));

                    predictNum = date.AddDays(1).ToString("yyyyMMdd") + "0001";
                }
                predictNum  = predictNum.Substring(0, 8) + "-" + predictNum.Substring(8, 4);
                label2.Text = nums[0];
                label3.Text = nums[1];
                var selectNum = "";
                for (var i = 0; i <= 9; i++)
                {
                    if (i.ToString() != label2.Text && i.ToString() != label3.Text)
                    {
                        if (selectNum.Length != 14)
                        {
                            selectNum += i.ToString();
                        }
                        else
                        {
                            selectNum += i.ToString();
                        }
                    }
                }
                label6.Text = "-,-," + selectNum + "," + selectNum + "," + selectNum;

                this.label1.Visible  = true;
                this.label2.Visible  = true;
                this.label3.Visible  = true;
                this.label4.Visible  = true;
                this.label5.Visible  = true;
                this.label6.Visible  = true;
                this.button2.Visible = true;
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog(ex.Message, ex);
            }
            finally {
                timer1.Start();
            }
        }
Exemplo n.º 9
0
        public List <string> GetTwoKillNo(int payIndex, List <DB_PredictRecord> records, ref DB_PredictRecord item)
        {
            List <string>         nums = new List <string>();
            Dictionary <int, int> ne   = new Dictionary <int, int>();

            ne[0] = 0;
            ne[1] = 0;
            ne[2] = 0;
            ne[3] = 0;
            ne[4] = 0;
            ne[5] = 0;
            ne[6] = 0;
            ne[7] = 0;
            ne[8] = 0;
            ne[9] = 0;
            List <string> rlt = new List <string>();

            //先选出前两期出现了两次的号

            foreach (var key in ne.Keys)
            {
                if (GetThreeNo(records[payIndex - 1].GoodNo).Contains(key.ToString()) && GetThreeNo(records[payIndex - 2].GoodNo).Contains(key.ToString()))
                {
                    rlt.Add(key.ToString());
                }
            }

            if (rlt.Count > 1)
            {
                item.Kill3No = rlt[0];
                item.Kill5No = rlt[1];
                nums.Add(item.Kill3No);
                nums.Add(item.Kill5No);
                //return CheckWin(rlt[0], rlt[1], records[payIndex].GoodNo, true);
            }
            var firstNum  = "";
            var secondNum = "";

            //能取到一个号
            if (rlt.Count == 1)
            {
                firstNum     = rlt[0];
                secondNum    = SelectColdNo(payIndex, records, null, true);
                item.Kill3No = firstNum;
                item.Kill5No = secondNum;
                nums.Add(item.Kill3No);
                nums.Add(item.Kill5No);
                //return CheckWin(firstNum, secondNum, records[payIndex].GoodNo, true);
            }
            //一个号都不能取到,选择冷号集合(两个冷号)
            else
            {
                firstNum     = SelectColdNo(payIndex, records, null, true);
                secondNum    = SelectColdNo(payIndex, records, firstNum, true);
                item.Kill3No = firstNum;
                item.Kill5No = secondNum;
                nums.Add(item.Kill3No);
                nums.Add(item.Kill5No);
                //return CheckWin(firstNum, secondNum, records[payIndex].GoodNo, true);
            }

            return(nums);
        }
Exemplo n.º 10
0
        public bool IsWinByKillTwoNum(int payIndex, List <DB_PredictRecord> records, ref DB_PredictRecord item)
        {
            if (!string.IsNullOrEmpty(this.KillNo1) && !string.IsNullOrEmpty(this.KillNo2))
            {
                item.Kill3No = this.KillNo1;
                item.Kill5No = this.KillNo2;
                return(CheckWin(this.KillNo1, this.KillNo2, records[payIndex].GoodNo));
            }


            bool flag = false;
            Dictionary <int, int> ne = new Dictionary <int, int>();

            ne[0] = 0;
            ne[1] = 0;
            ne[2] = 0;
            ne[3] = 0;
            ne[4] = 0;
            ne[5] = 0;
            ne[6] = 0;
            ne[7] = 0;
            ne[8] = 0;
            ne[9] = 0;
            List <string> rlt = new List <string>();

            //先选出前两期出现了两次的号

            foreach (var key in ne.Keys)
            {
                if (GetThreeNo(records[payIndex - 1].GoodNo).Contains(key.ToString()) && GetThreeNo(records[payIndex - 2].GoodNo).Contains(key.ToString()))
                {
                    rlt.Add(key.ToString());
                }
            }

            if (rlt.Count > 1)
            {
                item.Kill3No = rlt[0];
                item.Kill5No = rlt[1];
                return(CheckWin(rlt[0], rlt[1], records[payIndex].GoodNo));
            }
            var firstNum  = "";
            var secondNum = "";

            //能取到一个号
            if (rlt.Count == 1)
            {
                firstNum     = rlt[0];
                secondNum    = SelectColdNo(payIndex, records, null, true);
                item.Kill3No = firstNum;
                item.Kill5No = secondNum;

                return(CheckWin(firstNum, secondNum, records[payIndex].GoodNo));
            }
            //一个号都不能取到,选择冷号集合(两个冷号)
            else
            {
                firstNum     = SelectColdNo(payIndex, records, null, true);
                secondNum    = SelectColdNo(payIndex, records, firstNum, true);
                item.Kill3No = firstNum;
                item.Kill5No = secondNum;

                return(CheckWin(firstNum, secondNum, records[payIndex].GoodNo));
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 后三位独立运算
        /// </summary>
        /// <param name="payIndex"></param>
        /// <param name="records"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool IsWinByKillTwoNum_Individual(int payIndex, List <DB_PredictRecord> records, ref DB_PredictRecord item)
        {
            var flag = true;

            var mums = this.GetTwoKillNo_Individual(payIndex, records);

            item.Kill3No = mums[0];
            item.Kill5No = mums[1];
            return(CheckWin(mums[0], mums[1], records[payIndex].GoodNo));
        }