| | |
| | | m_model = new QStandardItemModel(this); |
| | | ui->tableView->setModel(m_model); |
| | | |
| | | m_modelResult = new QStandardItemModel(this); |
| | | ui->tableView_2->setModel(m_modelResult); |
| | | |
| | | QStringList labels; |
| | | labels<<"股票名字"<<"市值"<<"收盘价"<<"涨跌幅"<<"排名"<<"交易时间"<<"排名变化"; |
| | | m_model->setHorizontalHeaderLabels(labels); |
| | | m_modelResult->setHorizontalHeaderLabels(labels); |
| | | } |
| | | |
| | | AnalysisByRedisCache::~AnalysisByRedisCache() |
| | |
| | | |
| | | int rank_val = 0; |
| | | int cnt = 0; |
| | | int bigFlag = false; |
| | | for(auto it:m_result){ |
| | | if(it["name"].toString() == name){ |
| | | // qDebug()<<it["name"].toString()<<it["close"].toString()<<it["amount_rank"].toString()<<it["time_trade"].toString(); |
| | |
| | | QStandardItem * amount_rank_item = new QStandardItem(QString::number(rank_rate)); |
| | | if(rank_rate > 0.9){ |
| | | amount_rank_item->setData(QColor("red"),Qt::BackgroundColorRole); |
| | | bigFlag = true; |
| | | } |
| | | items.append(amount_rank_item); |
| | | |
| | |
| | | } |
| | | |
| | | m_model->appendRow(items); |
| | | if(bigFlag){ |
| | | QList<QStandardItem*> items_2; |
| | | for(int i=0;i<items.size();++i){ |
| | | items_2.append(new QStandardItem(items.at(i)->text())); |
| | | if(i==6 && items.at(i)->text().toDouble() > 0.95){ |
| | | items_2.back()->setData(QColor("red"),Qt::BackgroundColorRole); |
| | | } |
| | | } |
| | | m_modelResult->appendRow(items_2); |
| | | bigFlag = false; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | // 批量分析 |
| | | // 重设模型的行数为0,清空一下数据 |
| | | m_model->setRowCount(0); |
| | | m_modelResult->setRowCount(0); |
| | | |
| | | int batch_num = ui->comboBox_batchNum->currentText().toInt(); // 批量分析个股的数量 |
| | | // 拿出个股交易额排名的前N名,进行缓存分析 |