From 1d9df6677912a982a4676f4bf9bdc2612ceb68cc Mon Sep 17 00:00:00 2001
From: wumu <mayi@mayi.com>
Date: 星期四, 16 一月 2025 21:50:10 +0800
Subject: [PATCH] 0116

---
 getstocklist.cpp |  318 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 300 insertions(+), 18 deletions(-)

diff --git a/getstocklist.cpp b/getstocklist.cpp
index d9f0fa0..f7732ca 100644
--- a/getstocklist.cpp
+++ b/getstocklist.cpp
@@ -41,7 +41,11 @@
     QStringList labels;
     labels<<"鑲$エ鍚嶅瓧"<<"鑲$エ浠e彿"<<"鎬诲競鍊�(浜�)"<<"娴侀�氬競鍊�(浜�)"<<"娑ㄨ穼骞�(%)"<<"鏀剁洏浠�"<<"鎴愪氦棰�(浜�)"<<"鎴愪氦閲�(鎵�)"<<"鎹㈡墜鐜�(%)"<<"甯傜泩鐜�";
     m_model->setHorizontalHeaderLabels(labels); // 璁剧疆妯″瀷鐨勫垪鏍囩鍚�
-    ui->tableView->setModel(m_model); // 灏嗘ā鍨嬪拰瑙嗗浘鍏宠仈
+    m_customModel = new CustomSortProxyModel;
+    m_customModel->setSourceModel(m_model); // 璁剧疆婧愭ā鍨�
+
+    //ui->tableView->setModel(m_model); // 灏嗘ā鍨嬪拰瑙嗗浘鍏宠仈
+    ui->tableView->setModel(m_customModel); // 璁剧疆鑷畾涔夋帓搴忕殑妯″瀷
     ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); // 璁剧疆鍐呭鑷�傚簲锛屾媺浼�
 
     // 缁欒〃鏍艰鍥炬坊鍔犲彸鍑昏嚜瀹氫箟鑿滃崟
@@ -51,11 +55,19 @@
     m_menu = new QMenu(this);
 
     QMenu *dateMenu = new QMenu("璁剧疆鍛ㄦ湡");
+    QAction *m30Action = dateMenu->addAction("璁剧疆涓�30鍒�");
+    QAction *m60Action = dateMenu->addAction("璁剧疆涓�60鍒�");
+    QAction *m120Action = dateMenu->addAction("璁剧疆涓�120鍒�");
+    QAction *dayAction = dateMenu->addAction("璁剧疆涓烘棩");
     QAction *weekAction = dateMenu->addAction("璁剧疆涓哄懆");
     QAction *monthAction = dateMenu->addAction("璁剧疆涓烘湀");
     QAction *yearAction = dateMenu->addAction("璁剧疆涓哄勾");
     m_menu->addMenu(dateMenu);
 
+    connect(m30Action,&QAction::triggered,this,[&]{ m_dateType = "30m";});
+    connect(m60Action,&QAction::triggered,this,[&]{ m_dateType = "60m";});
+    connect(m120Action,&QAction::triggered,this,[&]{ m_dateType = "120m";});
+    connect(dayAction,&QAction::triggered,this,[&]{ m_dateType = "day";});
     connect(weekAction,&QAction::triggered,this,[&]{ m_dateType = "week";}); // 淇敼鏃ユ湡绫诲瀷
     connect(monthAction,&QAction::triggered,this,[&]{ m_dateType = "month";});
     connect(yearAction,&QAction::triggered,this,[&]{ m_dateType = "year";});
@@ -76,11 +88,36 @@
     connect(pre1000Action,&QAction::triggered,this,[&]{ m_maTestNum = 1000;});
     connect(pre5000Action,&QAction::triggered,this,[&]{ m_maTestNum = 5000;});
 
+    QMenu *timerMenu = new QMenu("璁剧疆杞鎵ц绛栫暐");
+    QAction *timerMultiResonateAction = timerMenu->addAction("杞澶氱瓥鐣ュ叡鎸�");
+
+    m_menu->addMenu(timerMenu);
+
+    m_pollMultiTimer = new QTimer(this);
+    connect(m_pollMultiTimer,SIGNAL(timeout()),this,SLOT(pollMultiSlot()));
+
+    connect(timerMultiResonateAction,&QAction::triggered,this,[&] {
+        static int cnt=0;
+        if(cnt % 2 == 0){
+            m_pollMultiTimer->start(1000*60);
+            qDebug()<<"鍚姩杞澶氱瓥鐣ュ叡鎸殑瀹氭椂鍣�";
+        }else{
+            m_pollMultiTimer->stop();
+            qDebug()<<"鍋滄杞澶氱瓥鐣ュ叡鎸瓥鐣�";
+        }
+    }); // 杞澶氱瓥鐣ュ叡鎸�
+
+
     QAction *policy = m_menu->addAction("绛栫暐鍒嗘瀽");
     QAction *price =  m_menu->addAction("鏈�鏂颁环鏍�");
     QAction *maPolicy = m_menu->addAction("MA绛栫暐");
     QAction *macdPolicy = m_menu->addAction("MACD绛栫暐");
     QAction *maTest100 = m_menu->addAction("MA绛栫暐-鍥炴祴");
+    QAction *buttomToUpPolicy = m_menu->addAction("搴曢儴鍙嶈浆绛栫暐");
+    QAction *multiResonatePolicy = m_menu->addAction("澶氱瓥鐣ュ叡鎸�");
+    QAction *multiResonateTest100 = m_menu->addAction("澶氱瓥鐣ュ叡鎸�-鍥炴祴");
+    QAction *oneUpCrossFourPolicy = m_menu->addAction("涓�闃崇┛鍥涚嚎绛栫暐");
+    QAction *oneUpCrossFourTest100 = m_menu->addAction("涓�闃崇┛鍥涚嚎绛栫暐-鍥炴祴");
 
 
 
@@ -89,7 +126,11 @@
     connect(maPolicy,SIGNAL(triggered(bool)),this,SLOT(maPolicySlot())); // MA鍧囩嚎绛栫暐
     connect(macdPolicy,SIGNAL(triggered(bool)),this,SLOT(macdPolicySlot())); // MA鍧囩嚎绛栫暐
     connect(maTest100,SIGNAL(triggered(bool)),this,SLOT(maTest100Slot())); // MA鍥炴祴鍓�100鍚�
-
+    connect(buttomToUpPolicy,SIGNAL(triggered(bool)),this,SLOT(buttomToUpPolicySlot())); // 搴曢儴鍙嶈浆绛栫暐
+    connect(multiResonatePolicy,SIGNAL(triggered(bool)),this,SLOT(multiResonatePolicySlot())); // 澶氱瓥鐣ュ叡鎸�
+    connect(multiResonateTest100,SIGNAL(triggered(bool)),this,SLOT(multiResonateTest100Slot())); // 澶氱瓥鐣ュ叡鎸洖娴�
+    connect(oneUpCrossFourPolicy,SIGNAL(triggered(bool)),this,SLOT(oneUpCrossFourSlot())); // 涓�闃崇┛鍥涚嚎绛栫暐
+    connect(oneUpCrossFourTest100,SIGNAL(triggered(bool)),this,SLOT(oneUpCrossFourTest100Slot())); // 涓�闃崇┛鍥涚嚎鍥炴祴
 
 
     // 澶勭悊鏁版嵁鐖彇鐨勬搷浣�
@@ -116,14 +157,16 @@
     on_pushButton_get_clicked();
 
     // 琛ㄦ牸鍒楁帓搴�
-    ui->tableView->setSortingEnabled(false);
-    ui->tableView->horizontalHeader()->setSortIndicatorShown(false);
-    connect(ui->tableView->horizontalHeader(),&QHeaderView::sortIndicatorChanged,this,[=](int index,Qt::SortOrder order){
-        qDebug()<<"sort:"<<index<<order;
-        m_model->sort(index,order);
-        ui->tableView->horizontalHeader()->setSortIndicatorShown(true);
+    ui->tableView->setSortingEnabled(true);
+//    ui->tableView->setSortingEnabled(false);
+//    ui->tableView->horizontalHeader()->setSortIndicatorShown(false);
+//    connect(ui->tableView->horizontalHeader(),&QHeaderView::sortIndicatorChanged,this,[=](int index,Qt::SortOrder order){
+//        qDebug()<<"sort:"<<index<<order;
+//        //m_model->sort(index,order);
+//        m_customModel->sort(index,order);
+//        ui->tableView->horizontalHeader()->setSortIndicatorShown(true);
 
-    });
+//    });
 
     // 瀹氭椂鑾峰彇鑲$エ浠e彿鐨勫畾鏃跺櫒鐩稿叧
     m_getCodeTimer = new QTimer(this);
@@ -188,6 +231,7 @@
             rowItems.append(new QStandardItem(symbol));
             rowItems.append(new QStandardItem(QString::number(market_capital,'f',2)));
             rowItems.append(new QStandardItem(QString::number(float_market_capital)));
+            //rowItems.append(new CustomItem(QString::number(float_market_capital)));
             QStandardItem *percentItem =  new QStandardItem(QString::number(percent));
             if(percent > 0){
                 percentItem->setData(QColor("red"),Qt::DecorationRole); // 娣诲姞涓�涓楗扮殑棰滆壊涓虹孩鑹�
@@ -341,6 +385,137 @@
                         macd_buy = 1;
                         oldVolume = volume;
                     }
+                }
+            }else if(m_menuIndex == 4){
+                // 搴曢儴鍙嶈浆绛栫暐,鎻愬墠鐨勬劅鐭ョ殑鏃堕棿浼氭洿鏃╋紝寰楀埌鏇村ソ鐨勯鍒よ秼鍔�
+               // qDebug()<<"搴曢儴鍙嶈浆绛栫暐";
+                if(i > 0){
+                    double volume_cur = jArr.at(i).toArray().at(1).toDouble();
+                    double volume_old = jArr.at(i-1).toArray().at(1).toDouble();
+                    double volume_rate = volume_cur / volume_old;
+                    if(volume_rate > 2){
+                        qDebug()<<"搴曢儴鍙嶈浆绛栫暐:閲忚兘姣�"<<volume_rate<<code <<curDateTime<<"浠锋牸:" <<close;
+                    }
+                }
+
+            }else if(m_menuIndex == 5){
+                // 澶氱瓥鐣ュ叡鎸�:閲忚兘銆丮ACD銆丮A銆丅OLL
+
+                int cnt = 0;
+                // 閲忚兘
+                if(i > 0){
+                    double volume_cur = jArr.at(i).toArray().at(1).toDouble();
+                    double volume_old = jArr.at(i-1).toArray().at(1).toDouble();
+                    double volume_rate = volume_cur / volume_old;
+                    if(volume_rate > 2){
+                        cnt++;
+                        qDebug()<<"澶氱瓥鐣ュ叡鎸�:閲忚兘姣�"<<volume_rate<<code <<curDateTime<<"浠锋牸:" <<close;
+                        QString info = QString("<font size=8 color=red> %4 澶氱瓥鐣ュ叡鎸�:閲忚兘绛栫暐 鏃堕棿:%1 浠锋牸:%2 閲忚兘姣斿��=%3  鍏辨尟鍊�:%5</font>").arg(curDateTime).arg(close).arg(volume_rate).arg(code).arg(cnt);
+                        emit sendInfoMess(info);
+                    }
+                }
+
+                // MACD绛栫暐 缁撳悎鎴愪氦閲忔潵鍒ゆ柇浼氭洿濂�:涔板叆鐐规垚浜ら噺缁х画鏀惧ぇ鍒欐寔鏈夛紝缂╁皬鍒欑鍦�
+                double dea = jArr.at(i).toArray().at(16).toVariant().toDouble();
+                double dif = jArr.at(i).toArray().at(17).toVariant().toDouble();
+                double macd = jArr.at(i).toArray().at(18).toVariant().toDouble();
+
+                if(macd_buy == 1 && oldVolume > volume){
+                    QString info = QString("<font size=8 color=green> %4 MACD 鎴愪氦閲忓垵娆¤椤� 绂诲満1:%1 浠锋牸:%2 MACD=%3  </font>").arg(curDateTime).arg(close).arg(macd).arg(code);
+                    emit sendInfoMess(info);
+                    macd_buy = 0;
+                    oldVolume = 0;
+
+                }
+                if(i > 0){
+                    double dea_old = jArr.at(i-1).toArray().at(16).toVariant().toDouble();
+                    double dif_old = jArr.at(i-1).toArray().at(17).toVariant().toDouble();
+                    double macd_old = jArr.at(i-1).toArray().at(18).toVariant().toDouble();
+
+                    if(dif_old > dea_old && dif <= dea){
+                        // 姝诲弶
+                        qDebug()<<"MACD姝诲弶:"<<curDateTime<<" 浠锋牸:"<<close <<"MACD="<<macd ;
+                        QString info=QString("<font size=8 color=green> %4 MACD姝诲弶:%1 浠锋牸:%2 MACD=%3  </font>").arg(curDateTime).arg(close).arg(macd).arg(code);
+                        emit sendInfoMess(info);
+                    }else if(dif_old < dea_old && dif >= dea){
+                        // 閲戝弶
+                        cnt++;
+                        qDebug()<<"MACD閲戝弶:"<<curDateTime<<" 浠锋牸:"<<close <<"MACD="<<macd <<"寤鸿璁板綍褰撳墠閲戝弶MACD鐨勫�硷紝鑻ュ悗闈㈡湁浣庝簬姝ゅ�硷紝鍏虫敞绂诲満鎻愮ず";
+                        QString info=QString("<font size=9 color=red> %4 MACD閲戝弶:%1 浠锋牸:%2 MACD=%3 鍏辨尟鍊�:%5  </font>").arg(curDateTime).arg(close).arg(macd).arg(code).arg(cnt);
+                        emit sendInfoMess(info);
+
+                        macd_buy = 1;
+                        oldVolume = volume;
+                    }
+                }
+
+
+                // MA  ma10浜a20 閲戝弶锛宮a10浜a60 姝诲弶
+                double ma5 = jArr.at(i).toArray().at(12).toVariant().toDouble();
+                double ma10 = jArr.at(i).toArray().at(13).toVariant().toDouble();
+                double ma20 = jArr.at(i).toArray().at(14).toVariant().toDouble();
+                double ma30 = jArr.at(i).toArray().at(15).toVariant().toDouble();
+                //qDebug()<<"MA5-10-20-30"<<ma5<<ma10<<ma20<<ma30;
+                if(i>0){
+                    double ma5_old = jArr.at(i-1).toArray().at(12).toVariant().toDouble();
+                    double ma10_old = jArr.at(i-1).toArray().at(13).toVariant().toDouble();
+                    double ma20_old = jArr.at(i-1).toArray().at(14).toVariant().toDouble();
+                    double ma30_old = jArr.at(i-1).toArray().at(15).toVariant().toDouble();
+
+//                    if(ma5_old > ma20_old && ma5 <= ma20){
+//                        // 姝诲弶
+//                        qDebug()<<"MA5-20姝诲弶:"<<curDateTime<<" 浠锋牸:"<<close;
+//                    }else if(ma5_old < ma20_old && ma5 >= ma20){
+//                        // 閲戝弶
+//                        qDebug()<<"MA5-20閲戝弶:"<<curDateTime<<" 浠锋牸:"<<close;
+//                    }
+
+                    if(ma10_old > ma20_old && ma10 <= ma20){
+                        // 姝诲弶
+                        qDebug()<<"MA10-20姝诲弶:"<<curDateTime<<" 浠锋牸:"<<close;
+                        if(buy_price == 0) buy_price = close;
+                        double tmp_rate = (close-buy_price)/buy_price;
+                        rate_all += tmp_rate;
+
+                        QString info = QString("<font size=8 color=green> %3 %6 MA10-20姝诲弶:%1 浠锋牸:%2   鐩堝埄姣�:%4  鎬荤泩鍒�:%5</font>").arg(curDateTime).arg(close).arg(code)
+                                .arg(QString::number(tmp_rate*100)).arg(QString::number(rate_all*100)).arg(m_codeNames[code]);
+                        emit sendInfoMess(info);
+                        //buy_price = close; // 姝诲弶涔板叆鐨勬儏鍐�
+                    }else if(ma10_old < ma20_old && ma10 >= ma20){
+                        // 閲戝弶
+                        cnt++;
+                        buy_price = close; // 閲戝弶涔板叆鐨勬儏鍐�
+
+                        qDebug()<<"MA10-20閲戝弶:"<<curDateTime<<" 浠锋牸:"<<close;
+                        QString info = QString("<font size=8 color=red> %3 %4 MA10-20閲戝弶:%1 浠锋牸:%2 鍏辨尟鍊�:%5 </font>").arg(curDateTime).arg(close).arg(code).arg(m_codeNames[code]).arg(cnt);
+                                //.arg(QString::number(tmp_rate*100)).arg(QString::number(rate_all*100));
+                        emit sendInfoMess(info);
+
+                    }
+                }
+
+            }else if(m_menuIndex == 6){
+                // 涓�闃崇┛鍥涚嚎
+
+                double ma5 = jArr.at(i).toArray().at(12).toVariant().toDouble();
+                double ma10 = jArr.at(i).toArray().at(13).toVariant().toDouble();
+                double ma20 = jArr.at(i).toArray().at(14).toVariant().toDouble();
+                double ma30 = jArr.at(i).toArray().at(15).toVariant().toDouble();
+
+                double open = jArr.at(i).toArray().at(2).toVariant().toDouble();
+
+                double volume_rate = 0;
+                if(i > 0){ // 璁$畻閲忚兘姣�
+                    double volume_cur = jArr.at(i).toArray().at(1).toDouble();
+                    double volume_old = jArr.at(i-1).toArray().at(1).toDouble();
+                    volume_rate = volume_cur / volume_old;
+                }
+
+                if(ma5 >= open && ma10 >= open && ma20 >= open && ma30 >= open
+                        && ma5 <= close && ma10 <= close && ma20 <= close && ma30 <= close){
+                    qDebug()<<"涓�闃崇┛鍥涚嚎:"<< code <<curDateTime<<" 浠锋牸:"<<close << "閲忚兘姣�:"<<volume_rate;
+                    QString info = QString("<font size=8 color=red> %3 %4 涓�闃崇┛鍥涚嚎:%1 浠锋牸:%2 閲忚兘姣�:%5 鍛ㄦ湡:%6 </font>").arg(curDateTime).arg(close).arg(code).arg(m_codeNames[code]).arg(volume_rate).arg(m_dateType);
+                    emit sendInfoMess(info);
                 }
             }
 
@@ -533,12 +708,14 @@
     if(m_model->rowCount() == 0)return; // 闃叉寮傚父
 
     int row = ui->tableView->currentIndex().row(); // 鍙栧嚭鑿滃崟鎵�鍦ㄧ殑琛屽彿
-    QString symbol = m_model->item(row,1)->text(); // 鍙栧綋鍓嶈鎵�鍦ㄧ殑鑲$エ浠e彿
+//    QString symbol = m_model->item(row,1)->text(); // 鍙栧綋鍓嶈鎵�鍦ㄧ殑鑲$エ浠e彿
+    QString symbol = m_customModel->data(m_customModel->index(row,1)).toString();
     qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
     m_numsCnt = 30; // 杩欓噷鏄缃幏鍙栧崟涓偂绁ㄧ殑鏁版嵁閲�
     QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=week&type=before&count=-%3&indicator=kline").arg(symbol).arg(begin).arg(m_numsCnt);
     qDebug()<<urlStr;
-    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_model->item(row,0)->text();
+//    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_model->item(row,0)->text();
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(row,0)).toString();
     // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
     m_menuIndex = 0; // 绗竴涓彍鍗�
     m_request.setUrl(QUrl(urlStr)); // 璁剧疆鏂扮殑缃戝潃
@@ -550,7 +727,8 @@
     qDebug()<<"鏈�鏂颁环鏍�";
     if(m_model->rowCount() == 0)return;
     int row = ui->tableView->currentIndex().row();
-    QString symbol = m_model->item(row,1)->text(); // 鍙栧綋鍓嶈鎵�鍦ㄧ殑鑲$エ浠e彿
+//    QString symbol = m_model->item(row,1)->text(); // 鍙栧綋鍓嶈鎵�鍦ㄧ殑鑲$エ浠e彿
+    QString symbol = m_customModel->data(m_customModel->index(row,1)).toString();
     qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
     int numsCnt = 20;
     QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=day&type=before&count=-%3&indicator=kline").arg(symbol).arg(begin).arg(numsCnt);
@@ -567,12 +745,14 @@
     qDebug()<<"鎵цMA绛栫暐";
     emit sendInfoMess("<font size=12 color=pink>鎵цMA绛栫暐 </font>");
     int curRow = ui->tableView->currentIndex().row();
-    QString symbol = m_model->item(curRow,1)->text();
+//    QString symbol = m_model->item(curRow,1)->text();
+    QString symbol = m_customModel->data(m_customModel->index(curRow,1)).toString();
     qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
     int numsCnt = 300;
     QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=%4&type=before&count=-%3&indicator=kline,ma").arg(symbol).arg(begin).arg(numsCnt).arg(m_dateType);
     qDebug()<<urlStr;
-    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_model->item(curRow,0)->text();
+//    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_model->item(curRow,0)->text();
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(curRow,0)).toString();
     // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
     m_menuIndex = 2; // 绗笁涓彍鍗曢」
     m_request.setUrl(QUrl(urlStr));
@@ -582,9 +762,22 @@
 
 void GetStockList::maTest100Slot()
 {
-    for(int i=0;i<m_model->rowCount() && i < m_maTestNum;++i){
-        ui->tableView->setCurrentIndex(m_model->index(i,0)); // 璁剧疆褰撳墠琛ㄦ牸绱㈠紩锛屼富瑕佹槸涓轰簡璁剧疆琛�
+//    for(int i=0;i<m_model->rowCount() && i < m_maTestNum;++i){
+//        ui->tableView->setCurrentIndex(m_model->index(i,0)); // 璁剧疆褰撳墠琛ㄦ牸绱㈠紩锛屼富瑕佹槸涓轰簡璁剧疆琛�
+//        maPolicySlot(); // 璋冪敤MA绛栫暐鍘诲洖娴�
+//    }
+
+    for(int i=0;i<m_customModel->rowCount() && i < m_maTestNum;++i){
+        ui->tableView->setCurrentIndex(m_customModel->index(i,0)); // 璁剧疆褰撳墠琛ㄦ牸绱㈠紩锛屼富瑕佹槸涓轰簡璁剧疆琛�
         maPolicySlot(); // 璋冪敤MA绛栫暐鍘诲洖娴�
+    }
+}
+
+void GetStockList::multiResonateTest100Slot()
+{
+    for(int i=0;i<m_customModel->rowCount() && i < m_maTestNum;++i){
+        ui->tableView->setCurrentIndex(m_customModel->index(i,0)); // 璁剧疆褰撳墠琛ㄦ牸绱㈠紩锛屼富瑕佹槸涓轰簡璁剧疆琛�
+        multiResonatePolicySlot(); // 璋冪敤澶氱瓥鐣ュ叡鎸瓥鐣ュ幓鍥炴祴
     }
 }
 
@@ -593,17 +786,101 @@
     qDebug()<<"鎵цMACD绛栫暐";
     emit sendInfoMess("<font size=12 color=pink>鎵цMACD绛栫暐 </font>");
     int curRow = ui->tableView->currentIndex().row();
-    QString symbol = m_model->item(curRow,1)->text();
+//    QString symbol = m_model->item(curRow,1)->text();
+
+    QString symbol = m_customModel->data(m_customModel->index(curRow,1)).toString();
     qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
     int numsCnt = 300;
     QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=week&type=before&count=-%3&indicator=kline,macd").arg(symbol).arg(begin).arg(numsCnt);
     qDebug()<<urlStr;
-    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_model->item(curRow,0)->text();
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(curRow,0)).toString();
     // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
     m_menuIndex = 3; // 绗洓涓彍鍗曢」
     m_request.setUrl(QUrl(urlStr));
     m_manager.get(m_request);
 
+}
+
+void GetStockList::buttomToUpPolicySlot()
+{
+    /*
+    澶嶇洏涔嬪墠鐨勬湀绾跨獊鐮存儏鍐碉紝鏀鹃噺涓婃定锛�5鍊嶅乏鍙筹紝骞朵笖鍦�60鏃ュ潎绾夸笂鍐查珮锛屼笉鍥炶惤锛屽ぇ姒傜巼鍙互缁х画鍐�
+    鍏虫敞濂藉啿鐨勫舰鎬侊紝鍔犱笂寰堝ソ鐨勬崲鎵嬬巼80%+锛岀敋鑷�100%+锛岃鏄庡厖鍒嗘崲鎵嬩簡锛岀獊鐮翠細鏇村ソ锛屾湁灏变細璧氬鍊�
+    骞朵笖澶氭棩鏌ョ湅锛屾瘮渚嬪�间竴鐩村湪鏀惧ぇ锛岃鏄庡緢闈犺氨锛屽氨鏄湁涓�涓暟鍊兼瘮渚嬬殑鐖崌杩囩▼锛岄偅灏卞彲浠ラ噸浠撲拱鍏ョ瓑鏀剁泭浜嗭紝鍙互缁樺埗涓�鏉℃洸绾挎潵瑙傚療鎯呭喌
+    */
+
+    qDebug()<<"鎵ц搴曢儴鍙嶈浆绛栫暐";
+    emit sendInfoMess("<font size=12 color=pink>鎵цMACD绛栫暐 </font>");
+    int curRow = ui->tableView->currentIndex().row();
+//    QString symbol = m_model->item(curRow,1)->text();
+
+    QString symbol = m_customModel->data(m_customModel->index(curRow,1)).toString();
+    qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
+    int numsCnt = 300;
+    QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=%4&type=before&count=-%3&indicator=kline,macd").arg(symbol).arg(begin).arg(numsCnt).arg(m_dateType);
+    qDebug()<<urlStr;
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(curRow,0)).toString();
+    // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
+    m_menuIndex = 4; // 绗簲涓彍鍗曢」
+    m_request.setUrl(QUrl(urlStr));
+    m_manager.get(m_request);
+}
+
+void GetStockList::multiResonatePolicySlot()
+{
+    qDebug()<<"澶氱瓥鐣ュ叡鎸�:閲忚兘銆丮ACD銆丮A銆丅OLL";
+    emit sendInfoMess("<font size=12 color=pink>鎵ц澶氱瓥鐣ュ叡鎸� </font>");
+    int curRow = ui->tableView->currentIndex().row();
+//    QString symbol = m_model->item(curRow,1)->text();
+
+    QString symbol = m_customModel->data(m_customModel->index(curRow,1)).toString();
+    qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
+    int numsCnt = 200;
+    QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=%4&type=before&count=-%3&indicator=kline,macd,ma,boll").arg(symbol).arg(begin).arg(numsCnt).arg(m_dateType);
+    qDebug()<<urlStr;
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(curRow,0)).toString();
+    // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
+    m_menuIndex = 5; // 绗叚涓彍鍗曢」
+    m_request.setUrl(QUrl(urlStr));
+    m_manager.get(m_request);
+}
+
+void GetStockList::oneUpCrossFourSlot()
+{
+    /*  涓�闃崇┛鍥涚嚎
+    K绾垮嚭鐜颁簡澶ч槼绾垮苟涓旇疮绌�4鏉″潎绾匡紝璇存槑鍦ㄧ寷娑ㄤ簡锛屽苟涓旈噺鑳戒篃璺熶笂鐨勮瘽锛屽氨璇存槑寮哄姴
+
+    鏃銆佸懆K銆佹湀K灏卞緢鏄庢樉銆�
+    澶ц秼鍔夸互鍛ㄣ�佹湀涓轰富锛岄�傚悎涓暱绾垮鐞�
+    ---------------------------
+    涔熼潪甯搁�傚悎瓒呯煭绾跨殑澶勭悊锛�30鍒嗐��60鍒嗐��120鍒嗙殑澶х┛闃崇嚎涔熷緢鏄庢樉
+    ---------------------------
+    灏辨槸寮�鐩樹环鍜屾敹鐩樹环鍖呭惈浜嗕竴涓尯闂达紝杩欎釜鍖洪棿鍐呴兘鎶奙a5 Ma10 Ma20 Ma30缁欏寘浣忎簡锛岃鏄庤Е鍙戜簡涓�闃崇┛鍥涚嚎
+    */
+    qDebug()<<"涓�闃崇┛鍥涚嚎绛栫暐";
+    emit sendInfoMess("<font size=12 color=pink>鎵ц涓�闃崇┛鍥涚嚎绛栫暐 </font>");
+    int curRow = ui->tableView->currentIndex().row();
+//    QString symbol = m_model->item(curRow,1)->text();
+
+    QString symbol = m_customModel->data(m_customModel->index(curRow,1)).toString();
+    qint64 begin = QDateTime::currentMSecsSinceEpoch(); // 鍙栧綋鍓嶆椂闂存埑
+    int numsCnt = 200;
+    QString urlStr = QString("https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%1&begin=%2&period=%4&type=before&count=-%3&indicator=kline,macd,ma,boll").arg(symbol).arg(begin).arg(numsCnt).arg(m_dateType);
+    qDebug()<<urlStr;
+    qDebug()<<"褰撳墠鑲$エ:"<<symbol<<m_customModel->data(m_customModel->index(curRow,0)).toString();
+    // 涓嬩竴姝ュ氨鏄牴鎹畊rl璇锋眰鍒扮殑鏁版嵁锛岃繘琛屽垎鏋�
+    m_menuIndex = 6; // 绗竷涓彍鍗曢」
+    m_request.setUrl(QUrl(urlStr));
+    m_manager.get(m_request);
+
+}
+
+void GetStockList::oneUpCrossFourTest100Slot()
+{
+    for(int i=0;i<m_customModel->rowCount() && i < m_maTestNum;++i){
+        ui->tableView->setCurrentIndex(m_customModel->index(i,0)); // 璁剧疆褰撳墠琛ㄦ牸绱㈠紩锛屼富瑕佹槸涓轰簡璁剧疆琛�
+        oneUpCrossFourSlot(); // 璋冪敤涓�闃崇┛鍥涚嚎鍘诲洖娴�
+    }
 }
 
 void GetStockList::getCodeSlot()
@@ -625,6 +902,11 @@
 
 }
 
+void GetStockList::pollMultiSlot()
+{
+    multiResonateTest100Slot(); // 澶氱瓥鐣ュ叡鎸洖娴�
+}
+
 void GetStockList::on_pushButton_industry_clicked()
 {
     // 鑾峰彇琛屼笟淇℃伅锛岃兘鎷垮埌 琛屼笟浠g爜鍜屽悕瀛楋紝绠�鍐欑瓑

--
Gitblit v1.8.0