当前位置: 首页 > news >正文

网站备份怎么做怎么自己做个网站

网站备份怎么做,怎么自己做个网站,科技部部长,北京商场购物卡目录 运行情况: ​编辑 结果json文件格式: 代码: 承接 【python_PyQt5开发验证K线视觉想法工具V1.1 _增加标记类型_线段】 博文 地址:python_PyQt5开发验证K线视觉想法工具V1.1 _增加标记类型_线段_程序猿与金融与科技的博客-…

目录

运行情况:

​编辑

结果json文件格式:

 代码:


承接 【python_PyQt5开发验证K线视觉想法工具V1.1 _增加标记类型_线段】 博文

地址:python_PyQt5开发验证K线视觉想法工具V1.1 _增加标记类型_线段_程序猿与金融与科技的博客-CSDN博客

运行情况:

1 选择“批量验证”

2 选择时间区间,与验证的数据相同的时间区间

3 选择股票日数据所在文件夹

4 选择标记结果json文件

5 可以选择某一个股票显示结果,也可以通过“上一个”,“下一个”按钮切换股票查看对应股票标记

结果json文件格式:

 代码:

 界面布局

 1 在 EyeCheckMainWidget 类中实现 fill_stack_widget_two 方法

    def fill_stack_widget_two(self):batch_choice_daily_dir_btn = QtWidgets.QPushButton('选择股票日数据文件夹')batch_choice_daily_dir_btn.clicked.connect(self.batch_choice_daily_dir_btn_clicked)self.batch_choice_daily_dir_lineedit = QtWidgets.QLineEdit()batch_results_file_btn = QtWidgets.QPushButton('批量结果json文件')batch_results_file_btn.clicked.connect(self.batch_results_file_btn_clicked)self.batch_results_file_lineedit = QtWidgets.QLineEdit()batch_layout_one = QtWidgets.QFormLayout()batch_layout_one.addRow(batch_choice_daily_dir_btn,self.batch_choice_daily_dir_lineedit)batch_layout_one.addRow(batch_results_file_btn,self.batch_results_file_lineedit)self.batch_targets_combox = QtWidgets.QComboBox()self.batch_targets_combox.currentTextChanged.connect(self.batch_targets_combox_currentTextChanged)batch_pre_btn = QtWidgets.QPushButton('上一个')batch_pre_btn.clicked.connect(self.batch_pre_btn_clicked)batch_next_btn = QtWidgets.QPushButton('下一个')batch_next_btn.clicked.connect(self.batch_next_btn_clicked)batch_layout_two = QtWidgets.QHBoxLayout()batch_layout_two.addWidget(self.batch_targets_combox)batch_layout_two.addWidget(batch_pre_btn)batch_layout_two.addWidget(batch_next_btn)batch_layout = QtWidgets.QVBoxLayout()batch_layout.addLayout(batch_layout_one)batch_layout.addLayout(batch_layout_two)self.stack_two.setLayout(batch_layout)pass

2 在 EyeCheckMainWidget 类  init_data 方法

    def init_data(self):self.please_select_str: str = '-- 请选择 --'self.single_settingMark_widget: QtWidgets.QWidget = Noneself.target_column_list: List[str] = ['xTick', 'open', 'close', 'highest', 'lowest']self.target_names_list: List[str] = []self.target_marks_map: Dict = {}self.batch_current_target_name: str = Nonepass

3 在 EyeCheckMainWidget 类 增加批量验证用到的方法

    def caculate_k_data_and_show(self,daily_file:str,title_name:str):left_point = self.left_point.date().toString('yyyy-MM-dd')right_point = self.right_point.date().toString('yyyy-MM-dd')left_datetime = datetime.datetime.strptime(left_point, '%Y-%m-%d')right_datetime = datetime.datetime.strptime(right_point, '%Y-%m-%d')if left_datetime >= right_datetime:QtWidgets.QMessageBox.information(self,'提示','请选择时间区间',QtWidgets.QMessageBox.Yes)returndf = pd.read_csv(daily_file, encoding='utf-8')df = df.loc[df['openPrice'] > 0].copy()df['o_date'] = pd.to_datetime(df['tradeDate'])df = df.loc[(df['o_date'] >= left_point) & (df['o_date'] <= right_point)].copy()df['open'] = df['openPrice'] * df['accumAdjFactor']df['close'] = df['closePrice'] * df['accumAdjFactor']df['highest'] = df['highestPrice'] * df['accumAdjFactor']df['lowest'] = df['lowestPrice'] * df['accumAdjFactor']df['xTick'] = df['tradeDate']k_data = {'whole_df': df,'whole_header': ['日期', '开盘', '收盘', '最高', '最低'],'whole_pd_header': self.target_column_list}self.graph_widget.first_setData(k_data)self.graph_title_label.setText(title_name)passdef batch_choice_daily_dir_btn_clicked(self):path = QtWidgets.QFileDialog.getExistingDirectory(self,'打开股票日数据所在目录','.')if not path:returnself.batch_choice_daily_dir_lineedit.setText(path)def batch_results_file_btn_clicked(self):path,_ = QtWidgets.QFileDialog.getOpenFileName(self,'打开标记计算结果json文件','.','JSON(*.json)')if not path:returntry:with open(path,'r',encoding='utf-8') as fr:json_obj = json.load(fr)self.target_marks_map = json_objself.target_names_list.clear()self.target_names_list = list(json_obj.keys())self.batch_targets_combox.clear()self.batch_current_target_name = Noneself.batch_targets_combox.addItem(self.please_select_str)self.batch_targets_combox.addItems(self.target_names_list)self.batch_results_file_lineedit.setText(path)passexcept Exception as e:print(e)QtWidgets.QMessageBox.information(self,'提示',e.__str__(),QtWidgets.QMessageBox.Yes)returnpassdef batch_targets_combox_currentTextChanged(self,txt:str):cur_txt = self.batch_targets_combox.currentText()if not cur_txt or cur_txt == self.please_select_str:returnself.batch_current_target_name = cur_txtself.batch_show_current_target()passdef batch_pre_btn_clicked(self):if not self.batch_current_target_name:self.batch_current_target_name = self.target_names_list[-1]else:node_index = self.target_names_list.index(self.batch_current_target_name)if node_index <=0:self.batch_current_target_name = self.target_names_list[-1]else:self.batch_current_target_name = self.target_names_list[node_index-1]passself.batch_show_current_target()passdef batch_next_btn_clicked(self):if not self.batch_current_target_name:self.batch_current_target_name = self.target_names_list[0]else:node_index = self.target_names_list.index(self.batch_current_target_name)if node_index >= len(self.target_names_list)-1:self.batch_current_target_name = self.target_names_list[0]else:self.batch_current_target_name = self.target_names_list[node_index+1]self.batch_show_current_target()passdef batch_show_current_target(self):self.mark_table.clear_table_contents()one_node = self.target_marks_map[self.batch_current_target_name]self.mark_table.set_data(one_node)# daily_file,title_namedaily_dir = self.batch_choice_daily_dir_lineedit.text()daily_file = daily_dir + os.path.sep + self.batch_current_target_name + '.csv'if not daily_dir or not os.path.exists(daily_file):QtWidgets.QMessageBox.information(self,'提示','股票日数据目录没有选择,或对应日数据不存在',QtWidgets.QMessageBox.Yes)returnself.caculate_k_data_and_show(daily_file,self.batch_current_target_name)self.graph_widget.add_marks(one_node)pass

http://www.khdw.cn/news/10083.html

相关文章:

  • 尚海整装和沪佳哪个好seo攻略
  • 炎陵做网站百度优化关键词
  • 个人博客网站模板源码友情链接多少钱一个
  • net网站建设入门教程站长工具精品
  • 怎么做微信网站关键词排名网站
  • 广州一次做网站接单平台
  • 上海官方网站建seo搜索引擎专员
  • 成都网站建设939优化软件
  • 全网营销型推广网站建设长沙县网络营销咨询
  • 汽车专业科技网站建设google浏览器官网入口
  • 随州网站建设无代码免费web开发平台
  • 部署推进网站建设平台推广方式有哪些
  • 深圳企业画册印刷湖南专业seo公司
  • dede后台网站主页广告推广平台网站
  • 海口网站建设推广发软文的平台
  • 旅游网站建设规划方案站长友情链接平台
  • 绍兴做网站选哪家官方百度
  • 购物网站功能长沙关键词自然排名
  • 烟台商城网站制作搜索引擎优化规则
  • 定兴做网站的外贸谷歌seo
  • 三线城市做网站需求长春做网站公司长春seo公司
  • 企业网站建设费用记入网站建设山东聚搜网络
  • 百度搜索自己的网站自己怎么建网站
  • 网站快照不更新了网址链接
  • 电脑上自己做科目一的网站公司企业网站建设
  • 做网站的天空网全免费建立自己的网站
  • 南宁定制网站建设最新的军事新闻
  • 网架加工厂有招工的吗哈尔滨seo优化
  • 在百度上做网站有用吗郴州seo网络优化
  • wordpress修改首页文章样式安卓优化神器