├── CreateBackTestProcess_Inheritance.py ├── CreateNewProcess_Inheritance.py ├── Donation_Inheritance.py ├── ExitDialog_Inheritance.py ├── KChart ├── K_Chart_Crosshair.py ├── K_Chart_Item.py ├── K_Chart_Widget.py └── K_Chart_assist.py ├── LICENSE ├── MainWindows_Inheritance.py ├── Main_Process_Function.py ├── README.md ├── RightButtonMenu.py ├── Setting_Inheritance.py ├── TQ_Services.py ├── UI ├── CreateBackTestProcess_dark.py ├── CreateBackTestProcess_dark.ui ├── CreateBackTestProcess_light.py ├── CreateBackTestProcess_light.ui ├── CreateNewProcess_dark.py ├── CreateNewProcess_dark.ui ├── CreateNewProcess_light.py ├── CreateNewProcess_light.ui ├── Delete_Warning_dark.py ├── Delete_Warning_dark.ui ├── Delete_Warning_light.py ├── Delete_Warning_light.ui ├── Donation_dark.py ├── Donation_light.py ├── Exit_dialog_dark.py ├── Exit_dialog_dark.ui ├── Exit_dialog_light.py ├── Exit_dialog_light.ui ├── LineStyle_dark.py ├── LineStyle_dark.ui ├── LineStyle_light.py ├── LineStyle_light.ui ├── ModifyParameters_dark.py ├── ModifyParameters_dark.ui ├── ModifyParameters_light.py ├── ModifyParameters_light.ui ├── Setting_dark.py ├── Setting_dark.ui ├── Setting_light.py ├── Setting_light.ui ├── mainwindows_dark.py ├── mainwindows_dark.ui ├── mainwindows_light.py └── mainwindows_light.ui ├── __pycache__ ├── CreateBackTestProcess.cpython-310.pyc ├── CreateBackTestWindow.cpython-310.pyc ├── CreateNewProcess.cpython-310.pyc ├── CreateNewProcessWindow.cpython-310.pyc ├── Donation.cpython-310.pyc ├── DonationWindow.cpython-310.pyc ├── ExitDialogWindow.cpython-310.pyc ├── Exit_dialog.cpython-310.pyc ├── MainWindowUI.cpython-310.pyc ├── Main_Process_Function.cpython-310.pyc ├── ReSetUI.cpython-310.pyc ├── RewriteCreateBackTestProcess.cpython-310.pyc ├── RewriteCreateNewProcess.cpython-310.pyc ├── RewriteDonation.cpython-310.pyc ├── RewriteExitDialog.cpython-310.pyc ├── RewriteMainWindows.cpython-310.pyc ├── RewriteSetting.cpython-310.pyc ├── Setting.cpython-310.pyc ├── dtview.cpython-310.pyc ├── mainwindows.cpython-310.pyc ├── read_write_file.cpython-310.pyc ├── resource_rc.cpython-310.pyc └── resourse_rc.cpython-310.pyc ├── available_contracts ├── CFFEX_Cont.csv ├── CFFEX_Future.csv ├── CFFEX_Index.csv ├── CFFEX_Main.csv ├── CFFEX_Option.csv ├── CZCE_Cont.csv ├── CZCE_Future.csv ├── CZCE_Index.csv ├── CZCE_Main.csv ├── CZCE_Option.csv ├── DCE_Cont.csv ├── DCE_Future.csv ├── DCE_Index.csv ├── DCE_Main.csv ├── DCE_Option.csv ├── INE_Cont.csv ├── INE_Future.csv ├── INE_Index.csv ├── INE_Main.csv ├── INE_Option.csv ├── SHFE_Cont.csv ├── SHFE_Future.csv ├── SHFE_Index.csv ├── SHFE_Main.csv └── SHFE_Option.csv ├── dtview.py ├── icons ├── 1246348342.png ├── 453453542155.png ├── Excel.svg ├── arrow-down-bold.svg ├── arrow-right-bold.svg ├── chrome.svg ├── 上.svg ├── 下.svg ├── 作者.svg ├── 关闭 (1).svg ├── 关闭.svg ├── 减号.svg ├── 分类.svg ├── 双下拉箭头.svg ├── 折叠-展开.svg ├── 更多.svg ├── 最大化-还原.svg ├── 最小化.svg ├── 清屏.svg ├── 箭头_向右.svg ├── 箭头_向左.svg ├── 缩小.svg ├── 菜单.svg ├── 警告.svg └── 设置.svg ├── logo ├── Default_photo.png └── logo.png ├── main.py ├── parameter.py ├── read_write_file.py ├── resource.qrc ├── resource_rc.py ├── strategys ├── DoubleMA.py ├── PingIP.py ├── __pycache__ │ ├── DMA_test.cpython-310.pyc │ ├── DoubleMA.cpython-310.pyc │ ├── Example.cpython-310.pyc │ ├── PUBU_five.cpython-310.pyc │ ├── SingleMA.cpython-310.pyc │ ├── demo.cpython-310.pyc │ ├── pingItem.cpython-310.pyc │ ├── pingItem1.cpython-310.pyc │ ├── pingTest.cpython-310.pyc │ ├── ping_test.cpython-310.pyc │ └── read_write_file.cpython-310.pyc ├── pingTest.py └── read_write_file.py ├── test ├── 传入的元组示范.py ├── 官方双均线.py └── 策略公用模板.py ├── 自启动脚本.bat └── 进程交易者简介.pptx /Donation_Inheritance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from PySide6 import QtCore 4 | from PySide6.QtGui import QCursor, Qt 5 | from PySide6.QtWidgets import (QWidget) 6 | 7 | from UI.Donation_dark import Ui_Form as UI_dark 8 | from UI.Donation_light import Ui_Form as UI_light 9 | 10 | 11 | from main import THEME 12 | 13 | if THEME == "dark": 14 | UI = UI_dark 15 | else: 16 | UI = UI_light 17 | 18 | 19 | class Donation(QWidget, UI): # 捐赠窗口类 20 | def __init__(self): 21 | super(Donation, self).__init__() 22 | self.setupUi(self) 23 | 24 | # 不显示标题栏 25 | flags = QtCore.Qt.WindowFlags(Qt.FramelessWindowHint) 26 | self.setWindowFlags(flags) 27 | # 不显示空白边框 28 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 29 | # 设置透明度 30 | self.setWindowOpacity(0.95) 31 | 32 | self.label_5.setText('本项目github地址: https://github.com/shiyindebcd/ProcessTrader 点击跳转') 33 | self.label_5.setOpenExternalLinks(True) # 使其成为超链接 34 | self.label_5.setTextInteractionFlags(Qt.TextBrowserInteraction) 35 | 36 | self.label_6.setText('本项目gitee地址: https://gitee.com/shiyindebcd/ProcessTrader 点击跳转') 37 | self.label_6.setOpenExternalLinks(True) 38 | self.label_6.setTextInteractionFlags(Qt.TextBrowserInteraction) 39 | 40 | self.label_7.setText('B站软件用法详细解说地址: https://www.bilibili.com 点击跳转') 41 | self.label_7.setOpenExternalLinks(True) 42 | self.label_7.setTextInteractionFlags(Qt.TextBrowserInteraction) 43 | 44 | self.label_8.setText('YouTube软件详细解说地址: https://www.youtube.com 点击跳转') 45 | self.label_8.setOpenExternalLinks(True) 46 | self.label_8.setTextInteractionFlags(Qt.TextBrowserInteraction) 47 | 48 | self.label_9.setTextInteractionFlags(Qt.TextBrowserInteraction) 49 | self.label_10.setTextInteractionFlags(Qt.TextBrowserInteraction) 50 | self.label_11.setTextInteractionFlags(Qt.TextBrowserInteraction) 51 | 52 | 53 | def mousePressEvent(self, e): # 鼠标点击事件 54 | if e.button() == Qt.LeftButton: 55 | self.m_drag = True 56 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 57 | e.accept() 58 | self.setCursor(QCursor(Qt.OpenHandCursor)) 59 | 60 | def mouseReleaseEvent(self, e): # 鼠标释放事件 61 | if e.button() == Qt.LeftButton: 62 | self.m_drag = False 63 | self.setCursor(QCursor(Qt.ArrowCursor)) 64 | 65 | def mouseMoveEvent(self, e): # 鼠标拖动事件 66 | if Qt.LeftButton and self.m_drag: 67 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 68 | e.accept() 69 | 70 | 71 | -------------------------------------------------------------------------------- /ExitDialog_Inheritance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from PySide6 import QtCore 4 | from PySide6.QtGui import QCursor, Qt 5 | from PySide6.QtWidgets import (QDialog) 6 | 7 | from read_write_file import ReadWriteCsv 8 | from UI.Exit_dialog_dark import Ui_Dialog as UI_dark 9 | from UI.Exit_dialog_light import Ui_Dialog as UI_light 10 | 11 | 12 | from main import THEME 13 | 14 | if THEME == "dark": 15 | UI = UI_dark 16 | else: 17 | UI = UI_light 18 | 19 | 20 | class Exit_Dialog(QDialog, UI): # 退出程序对话框类 21 | def __init__(self): 22 | super(Exit_Dialog, self).__init__() 23 | self.setupUi(self) 24 | 25 | # 不显示标题栏 26 | self.setWindowFlags(QtCore.Qt.WindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)) 27 | # 不显示空白边框 28 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 29 | # 设置透明度 30 | self.setWindowOpacity(0.95) 31 | 32 | 33 | def mousePressEvent(self, e): # 鼠标点击事件 34 | if e.button() == Qt.LeftButton: 35 | self.m_drag = True 36 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 37 | e.accept() 38 | self.setCursor(QCursor(Qt.OpenHandCursor)) 39 | 40 | def mouseReleaseEvent(self, e): # 鼠标释放事件 41 | if e.button() == Qt.LeftButton: 42 | self.m_drag = False 43 | self.setCursor(QCursor(Qt.ArrowCursor)) 44 | 45 | def mouseMoveEvent(self, e): # 鼠标拖动事件 46 | if Qt.LeftButton and self.m_drag: 47 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 48 | e.accept() 49 | 50 | 51 | 52 | 53 | 54 | if THEME == 'dark': 55 | from UI.Delete_Warning_dark import Ui_Dialog 56 | else: 57 | from UI.Delete_Warning_light import Ui_Dialog 58 | class DeleteWarning(QDialog, Ui_Dialog): # 删除时警告对话框类 59 | 60 | def __init__(self): 61 | super(DeleteWarning, self).__init__() 62 | self.setupUi(self) 63 | 64 | # 不显示标题栏 65 | self.setWindowFlags(QtCore.Qt.WindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)) 66 | # 不显示空白边框 67 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 68 | # 设置透明度 69 | self.setWindowOpacity(0.95) 70 | 71 | def mousePressEvent(self, e): # 鼠标点击事件 72 | if e.button() == Qt.LeftButton: 73 | self.m_drag = True 74 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 75 | e.accept() 76 | self.setCursor(QCursor(Qt.OpenHandCursor)) 77 | 78 | def mouseReleaseEvent(self, e): # 鼠标释放事件 79 | if e.button() == Qt.LeftButton: 80 | self.m_drag = False 81 | self.setCursor(QCursor(Qt.ArrowCursor)) 82 | 83 | def mouseMoveEvent(self, e): # 鼠标拖动事件 84 | if Qt.LeftButton and self.m_drag: 85 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 86 | e.accept() 87 | 88 | 89 | 90 | 91 | if THEME == 'dark': 92 | from UI.ModifyParameters_dark import Ui_Form 93 | else: 94 | from UI.ModifyParameters_light import Ui_Form 95 | class ModifyParameters(QDialog, Ui_Form): # 修改策略参数窗口类 96 | 97 | def __init__(self, parent, rowIndex): 98 | super(ModifyParameters, self).__init__() 99 | self.parent = parent 100 | self.rowIndex = rowIndex 101 | self.setupUi(self) 102 | 103 | self.path = './data/config.csv' 104 | self.data = self.parent.ioModule.read_csv_file(self.path) 105 | self.init_dict = self.data.loc[self.rowIndex] 106 | self.finally_dict = {} 107 | 108 | # 不显示标题栏 109 | self.setWindowFlags(QtCore.Qt.WindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)) 110 | # 不显示空白边框 111 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 112 | # 设置透明度 113 | self.setWindowOpacity(0.95) 114 | self.Btn_submit_changes.clicked.connect(self.modify_config_parameters) 115 | self.add_paramters_to_cell() 116 | 117 | 118 | def mousePressEvent(self, e): # 鼠标点击事件 119 | if e.button() == Qt.LeftButton: 120 | self.m_drag = True 121 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 122 | e.accept() 123 | self.setCursor(QCursor(Qt.OpenHandCursor)) 124 | 125 | def mouseReleaseEvent(self, e): # 鼠标释放事件 126 | if e.button() == Qt.LeftButton: 127 | self.m_drag = False 128 | self.setCursor(QCursor(Qt.ArrowCursor)) 129 | 130 | def mouseMoveEvent(self, e): # 鼠标拖动事件 131 | if Qt.LeftButton and self.m_drag: 132 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 133 | e.accept() 134 | 135 | def add_paramters_to_cell(self): 136 | try: 137 | self.label_info.setText(str(self.init_dict['process_name'])) 138 | self.checkBox_whether_self_start.setChecked(self.init_dict['whether_self_start']) 139 | self.checkBox_whether_live_futures_trading.setChecked(self.init_dict['whether_live_trading']) 140 | self.checkBox_trading_status.setChecked(self.init_dict['trading_status']) 141 | self.checkBox_whether_open_web_services.setChecked(self.init_dict['whether_open_web_services']) 142 | self.checkBox_whether_open_line.setChecked(self.init_dict['whether_open_line']) 143 | self.checkBox_whether_close_line.setChecked(self.init_dict['whether_close_line']) 144 | 145 | self.web_port.setText(str(self.init_dict['web_port'])) 146 | self.symbol_period.setText(str(self.init_dict['symbol_period'])) 147 | self.initial_capital.setText(str(self.init_dict['initial_capital'])) 148 | self.orientation.setText(str(self.init_dict['orientation'])) 149 | self.contract_multiples.setText(str(self.init_dict['contract_multiples'])) 150 | self.margin_rate.setText(str(self.init_dict['margin_rate'])) 151 | self.stop_loss.setText(str(self.init_dict['stop_loss'])) 152 | self.stop_profit.setText(str(self.init_dict['stop_profit'])) 153 | self.open_line_Coordinates.setText(str(self.init_dict['open_line_Coordinates'])) 154 | self.close_line_Coordinates.setText(str(self.init_dict['close_line_Coordinates'])) 155 | self.long_add_times.setText(str(self.init_dict['long_add_times'])) 156 | self.short_add_times.setText(str(self.init_dict['short_add_times'])) 157 | 158 | self.Customized_parameters1.setText(str(self.init_dict['CP1'])) # Customized_parameters 为了方便使用,缩写为CP 159 | self.Customized_parameters2.setText(str(self.init_dict['CP2'])) 160 | self.Customized_parameters3.setText(str(self.init_dict['CP3'])) 161 | self.Customized_parameters4.setText(str(self.init_dict['CP4'])) 162 | self.Customized_parameters5.setText(str(self.init_dict['CP5'])) 163 | self.Customized_parameters6.setText(str(self.init_dict['CP6'])) 164 | self.Customized_parameters7.setText(str(self.init_dict['CP7'])) 165 | self.Customized_parameters8.setText(str(self.init_dict['CP8'])) 166 | self.Customized_parameters9.setText(str(self.init_dict['CP9'])) 167 | 168 | except Exception as e: 169 | print(e) 170 | pass 171 | def modify_config_parameters(self): 172 | 173 | self.finally_dict['process_name'] = (str(self.init_dict['process_name']).split('-',4)[0] + '-' + str(self.init_dict['process_name']).split('-',4)[1] + 174 | '-' + str(self.init_dict['process_name']).split('-',4)[2] + '-' + str(self.init_dict['process_name']).split('-',4)[3] + 175 | '-' + str(self.symbol_period.text()) + 'min') 176 | 177 | self.finally_dict['whether_self_start'] = self.checkBox_whether_self_start.isChecked() # 是否自启动 178 | self.finally_dict['whether_live_trading'] = self.checkBox_whether_live_futures_trading.isChecked() # 是否实盘交易 179 | self.finally_dict['trading_status'] = self.checkBox_trading_status.isChecked() # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 180 | self.finally_dict['whether_open_web_services'] = self.checkBox_whether_open_web_services.isChecked() 181 | self.finally_dict['whether_open_line'] = self.checkBox_whether_open_line.isChecked() # 是否定义了开仓直线 182 | self.finally_dict['whether_close_line'] = self.checkBox_whether_close_line.isChecked() # 是否定义了平仓直线 183 | 184 | self.finally_dict['web_port'] = self.web_port.text() # 网页端口 185 | self.finally_dict['symbol_period'] = self.symbol_period.text() # 合约周期 186 | self.finally_dict['initial_capital'] = self.initial_capital.text() # 初始资金 187 | self.finally_dict['orientation'] = self.orientation.text() # 交易方向,用于半自动化策略,0为无方向,1或正整数为做多,-1或负整数为做空 188 | self.finally_dict['contract_multiples'] = self.contract_multiples.text() # 合约倍数 189 | self.finally_dict['margin_rate'] = self.margin_rate.text() # 保证金率 190 | self.finally_dict['stop_loss'] = self.stop_loss.text() # 止损位 191 | self.finally_dict['stop_profit'] = self.stop_profit.text() # 止盈位 192 | self.finally_dict['open_line_Coordinates'] = self.open_line_Coordinates.text() # 开仓线坐标 193 | self.finally_dict['close_line_Coordinates'] = self.close_line_Coordinates.text() # 平仓线坐标 194 | 195 | self.finally_dict['client_name'] = self.init_dict['client_name'] 196 | self.finally_dict['tq_account'] = self.init_dict['tq_account'] 197 | self.finally_dict['tq_psd'] = self.init_dict['tq_psd'] 198 | self.finally_dict['futures_company'] = self.init_dict['futures_company'] 199 | self.finally_dict['futures_account'] = self.init_dict['futures_account'] 200 | self.finally_dict['futures_psd'] = self.init_dict['futures_psd'] 201 | self.finally_dict['symbol'] = self.init_dict['symbol'] 202 | self.finally_dict['strategy'] = self.init_dict['strategy'] 203 | self.finally_dict['whether_backtest'] = self.init_dict['whether_backtest'] 204 | self.finally_dict['final_capital'] = self.init_dict['final_capital'] 205 | 206 | self.finally_dict['long_add_times'] = self.long_add_times.text() 207 | self.finally_dict['long_current_position'] = self.init_dict['long_current_position'] 208 | self.finally_dict['first_long_price'] = self.init_dict['first_long_price'] 209 | self.finally_dict['first_long_deal'] = self.init_dict['first_long_deal'] 210 | self.finally_dict['short_add_times'] = self.short_add_times.text() 211 | self.finally_dict['short_current_position'] = self.init_dict['short_current_position'] 212 | self.finally_dict['first_short_price'] = self.init_dict['first_short_price'] 213 | self.finally_dict['first_short_deal'] = self.init_dict['first_short_deal'] 214 | 215 | self.finally_dict['CP1'] = self.Customized_parameters1.text() # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 216 | self.finally_dict['CP2'] = self.Customized_parameters2.text() # 自定义参数2 217 | self.finally_dict['CP3'] = self.Customized_parameters3.text() # 自定义参数3 218 | self.finally_dict['CP4'] = self.Customized_parameters4.text() # 自定义参数4 219 | self.finally_dict['CP5'] = self.Customized_parameters5.text() # 自定义参数5 220 | self.finally_dict['CP6'] = self.Customized_parameters6.text() # 自定义参数6 221 | self.finally_dict['CP7'] = self.Customized_parameters7.text() # 自定义参数7 222 | self.finally_dict['CP8'] = self.Customized_parameters8.text() # 自定义参数8 223 | self.finally_dict['CP9'] = self.Customized_parameters9.text() # 自定义参数9 224 | # print('最后的字典', self.finally_dict) 225 | 226 | self.data.loc[self.rowIndex] = self.finally_dict 227 | self.parent.ioModule.write_datas_to_csv_file(self.data, self.path) 228 | self.parent.load_process_config() 229 | 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /KChart/K_Chart_assist.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from datetime import datetime 4 | import pyqtgraph as pg 5 | from PySide6 import QtWidgets, QtCore, QtGui 6 | from PySide6.QtGui import Qt, QCursor 7 | from PySide6.QtWidgets import * 8 | from UI.LineStyle_dark import Ui_Form as UI_dark 9 | from UI.LineStyle_light import Ui_Form as UI_light 10 | 11 | from main import THEME 12 | 13 | if THEME == "dark": 14 | UI = UI_dark 15 | else: 16 | UI = UI_light 17 | 18 | 19 | 20 | # 绘制时,线条属性设置弹出框 21 | class LineStyleWidget(QWidget, UI): # 设置直线样式窗口类 22 | sinout_signal = QtCore.Signal(object) 23 | def __init__(self): 24 | super(LineStyleWidget, self).__init__() 25 | self.setupUi(self) 26 | # 不显示标题栏, 窗口总在最前 27 | flags = QtCore.Qt.WindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) 28 | self.setWindowFlags(flags) 29 | # 不显示空白边框 30 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 31 | # 设置透明度 32 | self.setWindowOpacity(0.95) 33 | # 设置窗口左上角初始位置和宽高 34 | self.setGeometry(300, 100, 320, 260) 35 | 36 | self.default_color: str = '#ff007f' 37 | self.init_ui() 38 | 39 | def init_ui(self): 40 | 41 | self.Btn_change_color.clicked.connect(self.Btn_change_color_clicked) 42 | self.Btn_previous_step.clicked.connect(self.Btn_previous_step_clicked) 43 | self.Btn_linewidth_check.clicked.connect(self.Btn_linewidth_check_clicked) 44 | 45 | self.Btn_change_color.setStyleSheet(u"QPushButton{ \n" 46 | " background-color:" + self.default_color + ";\n" 47 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 48 | " border-radius: 20px;\n" 49 | "}\n" 50 | "QPushButton:hover{\n" 51 | " border: 3px solid rgb(255, 200, 0); \n" 52 | "}\n" 53 | "QPushButton:pressed{\n" 54 | " color: green;\n" 55 | " border-color: rgb(255, 0, 0);\n" 56 | " background-color: rgb(255, 255, 0);\n" 57 | "}\n" 58 | "QPushButton:disabled{\n" 59 | " color: rgb(31, 31, 31);\n" 60 | " background-color: rgb(152, 152, 152);\n" 61 | "}") 62 | self.spinBox_linewidth.setValue(3) 63 | 64 | 65 | def Btn_change_color_clicked(self): 66 | col = QtWidgets.QColorDialog.getColor() 67 | if col.isValid(): 68 | pal = self.Btn_change_color.palette() 69 | pal.setColor(QtGui.QPalette.WindowText,col) 70 | # self.label_current_color.setPalette(pal) 71 | pre_map = { 72 | 'change_type':'color', 73 | 'data':col.name() 74 | } 75 | self.sinout_signal.emit(pre_map) 76 | pass 77 | 78 | def Btn_previous_step_clicked(self): 79 | pre_map = { 80 | 'change_type': 'pre_step', 81 | 'data': None 82 | } 83 | self.sinout_signal.emit(pre_map) 84 | pass 85 | 86 | def Btn_linewidth_check_clicked(self): 87 | line_width = self.spinBox_linewidth.value() 88 | if int(line_width)<=0: 89 | QtWidgets.QMessageBox.information( 90 | self, 91 | '提示', 92 | '线条粗细必须大于0', 93 | QtWidgets.QMessageBox.Yes 94 | ) 95 | return 96 | # linewidth 97 | pre_map = { 98 | 'change_type':'linewidth', 99 | 'data':int(line_width) 100 | } 101 | self.sinout_signal.emit(pre_map) 102 | pass 103 | 104 | 105 | def mousePressEvent(self, e): # 鼠标点击事件 106 | if e.button() == Qt.LeftButton: 107 | self.m_drag = True 108 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 109 | e.accept() 110 | self.setCursor(QCursor(Qt.OpenHandCursor)) 111 | 112 | def mouseReleaseEvent(self, e): # 鼠标释放事件 113 | if e.button() == Qt.LeftButton: 114 | self.m_drag = False 115 | self.setCursor(QCursor(Qt.ArrowCursor)) 116 | 117 | def mouseMoveEvent(self, e): # 鼠标拖动事件 118 | if Qt.LeftButton and self.m_drag: 119 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 120 | e.accept() 121 | 122 | 123 | 124 | ######################################################################## 125 | # 键盘鼠标功能 126 | ######################################################################## 127 | class KeyWraper(QWidget): 128 | """键盘鼠标功能支持的元类""" 129 | 130 | 131 | def __init__(self, parent=None): # 初始化 132 | QWidget.__init__(self, parent) 133 | self.setMouseTracking(True) # 设置鼠标跟踪 134 | self.autoFillBackground() 135 | 136 | 137 | def keyPressEvent(self, event): # 重载方法keyPressEvent(self,event),即按键按下事件方法 138 | if event.key() == QtCore.Qt.Key_Up: 139 | self.onUp() 140 | elif event.key() == QtCore.Qt.Key_Down: 141 | self.onDown() 142 | elif event.key() == QtCore.Qt.Key_Left: 143 | self.onLeft() 144 | elif event.key() == QtCore.Qt.Key_Right: 145 | self.onRight() 146 | elif event.key() == QtCore.Qt.Key_PageUp: 147 | self.onPre() 148 | elif event.key() == QtCore.Qt.Key_PageDown: 149 | self.onNxt() 150 | 151 | 152 | def mousePressEvent(self, event): # 重载方法mousePressEvent(self,event),即鼠标点击事件方法 153 | if event.button() == QtCore.Qt.RightButton: 154 | self.onRClick(event.pos()) 155 | elif event.button() == QtCore.Qt.LeftButton: 156 | self.onLClick(event.pos()) 157 | 158 | 159 | def mouseRelease(self, event): # 重载方法mouseReleaseEvent(self,event),即鼠标点击事件方法 160 | if event.button() == QtCore.Qt.RightButton: 161 | self.onRRelease(event.pos()) 162 | elif event.button() == QtCore.Qt.LeftButton: 163 | self.onLRelease(event.pos()) 164 | self.releaseMouse() 165 | 166 | 167 | def wheelEvent(self, event): # 重载方法wheelEvent(self,event),即滚轮事件方法 168 | return 169 | 170 | 171 | def paintEvent(self, event): # 重载方法paintEvent(self,event),即拖动事件方法 172 | self.onPaint() 173 | 174 | 175 | def onNxt(self): # PgDown键 176 | pass 177 | 178 | 179 | def onPre(self): # PgUp键 180 | pass 181 | 182 | 183 | def onUp(self): # 向上键和滚轮向上 184 | pass 185 | 186 | 187 | def onDown(self): # 向下键和滚轮向下 188 | pass 189 | 190 | 191 | def onLeft(self): # 向左键 192 | pass 193 | 194 | 195 | def onRight(self): # 向右键 196 | pass 197 | 198 | 199 | def onLClick(self, pos): # 鼠标左单击 200 | pass 201 | 202 | 203 | def onRClick(self, pos): # 鼠标右单击 204 | pass 205 | 206 | 207 | def onLRelease(self, pos): # 鼠标左释放 208 | pass 209 | 210 | 211 | def onRRelease(self, pos): # 鼠标右释放 212 | pass 213 | 214 | 215 | def onPaint(self): # 画图 216 | pass 217 | 218 | 219 | ######################################################################## 220 | # 时间序列,横坐标支持 221 | ######################################################################## 222 | class DatetimeAxis(pg.AxisItem): 223 | 224 | def __init__(self, datas, *args, **kwargs): 225 | super().__init__(*args, **kwargs) 226 | 227 | self.data = datas # 传入k线数据 228 | self.setPen(pg.mkPen(QtGui.QColor(255, 0, 0), width=1)) # 设置时间轴边框颜色 229 | self.tickFont = QtGui.QFont("Arial", 6) # 时间轴刻度字体 230 | 231 | 232 | def tickStrings(self, values: list[int], scale: float, spacing: int): 233 | """ 234 | Convert original index to datetime string. 235 | values自动传入x坐标 236 | """ 237 | # 行索引和时间组合字典,行索引和x轴对应 238 | datetime_index_map = dict(zip(self.data.index, self.data.datetime)) 239 | strings = [] 240 | for ix in values: 241 | dt = datetime_index_map.get(ix, None) # x轴对应的时间 242 | if not dt: 243 | s = "" 244 | else: 245 | dt = datetime.fromtimestamp(dt / 1e9) # 转换成datetime格式 246 | if dt.hour: # 日内周期 247 | s = dt.strftime("%m-%d %H:%M") 248 | else: 249 | s = dt.strftime("%Y-%m-%d") 250 | strings.append(s) 251 | return strings 252 | 253 | 254 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 进程交易者 2 |
3 | 4 | ## 介绍 5 |
6 | 一个用python实现的,基于pyside6和天勤SDK的,多用户,多进程期货程序化交易框架,可实现完全无人职守的自动化国内期货交易,或者半程序化交易 7 |

8 | 9 | 10 | ## 软件架构 11 |
12 | 软件基于pyside6实现各种界面,天勤sdk的包用于实际的期货交易过程 13 |

14 | 15 | 16 | ## 安装教程 17 |
18 | 19 | 1. 先安装python, 建议python版本在3.9以上 20 |
21 | 22 | 2. 在cmd里输入以下命令,安装必要的python包 23 | ~~~ 24 | pip install pyside6 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 25 | 26 | pip install tqsdk2 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 27 | 28 | pip install tqsdk -i https://pypi.tuna.tsinghua.edu.cn/simple/ 29 | 30 | pip install psutil -i https://pypi.tuna.tsinghua.edu.cn/simple/ 31 | 32 | pip install pywin32 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 33 | 34 | pip install ping3 -i https://pypi.tuna.tsinghua.edu.cn/simple/ 35 | 36 | pip install openpyxl -i https://pypi.tuna.tsinghua.edu.cn/simple/ 37 | 38 | pip install pyqtgraph -i https://pypi.tuna.tsinghua.edu.cn/simple/ 39 | 40 | ~~~ 41 | 42 | 3. 运行*main.py* 即可启动程序 43 | 44 | --- 45 | 46 | 47 |

48 | ## 使用说明 49 |
50 | 51 | 将*自启动脚本.bat* 这个文件里的第6行 52 | 53 | ~~~ 54 | cd E:\进程交易者 55 | ~~~ 56 | 57 | 这个地址改成你自己的本软件文件夹地址 58 | 59 | 双击 自启动脚本.bat 即可运行软件 60 | 61 |
62 | 63 | 要想让软件开机自启动, 就对这个bat文件创建个快捷方式,放到 64 | ~~~ 65 | C:\Users\你的电脑用户名\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 66 | ~~~ 67 | 文件夹下,即可实现开机自启动软件 68 |



69 | ## 主题切换 70 |
71 | 在 main.py 中,把 THEME 改成 dark 或 light ,即可切换到两种主题 72 |



73 | 74 | ## 详解视频 75 |
76 | 软件的详细用法请参考B站的视频解说 77 | 78 | [点此跳转到B站视频链接](https://www.bilibili.com/video/BV1tY4y177sv?share_source=copy_web&vd_source=0f0ae5e8365c85cd112830a14d80cef6) 79 | -------------------------------------------------------------------------------- /Setting_Inheritance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from PySide6 import QtCore 4 | from PySide6.QtGui import QCursor, Qt 5 | from PySide6.QtWidgets import (QDialog) 6 | import pandas as pd 7 | from read_write_file import ReadWriteCsv 8 | 9 | from UI.Setting_dark import Ui_Dialog as UI_dark 10 | from UI.Setting_light import Ui_Dialog as UI_light 11 | 12 | from main import THEME 13 | 14 | if THEME == "dark": 15 | UI = UI_dark 16 | else: 17 | UI = UI_light 18 | 19 | 20 | class SettingDialog(QDialog, UI): 21 | def __init__(self, parent): 22 | super(SettingDialog, self).__init__() 23 | self.setupUi(self) 24 | self.parent = parent 25 | 26 | # 不显示标题栏 27 | self.setWindowFlags(QtCore.Qt.WindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)) 28 | # 不显示空白边框 29 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground) 30 | # 设置透明度 31 | self.setWindowOpacity(0.95) 32 | self.path = './data/main_tq_account.csv' 33 | 34 | self.ioModule = self.parent.ioModule # 实例化读写csv文件的类 35 | self.ioModule.judge_file_exist(path=self.path) # 判断main_tq_account.csv是否存在,如果不存在,则创建 36 | self.data = self.ioModule.read_csv_file(path=self.path) # 读取main_tq_account.csv文件 37 | 38 | if self.data.empty: # 判断self.data是否为空 39 | print('当前未配置主程序天勤帐号') 40 | else: 41 | self.label_Account.setText('已配置天勤帐号: ' + str(self.data.iloc[0]['tq_account']) + ' 无需再配置') 42 | 43 | 44 | self.Btn_clear_main_tq_account.clicked.connect(self.clear_main_tq_account) 45 | self.Btn_Determine_add.clicked.connect(self.get_tq_account) 46 | self.Btn_Determine_add.setFocusPolicy(Qt.NoFocus) 47 | self.Btn_clear_input.clicked.connect(self.clear_input) 48 | self.Btn_clear_input.setFocusPolicy(Qt.NoFocus) 49 | 50 | 51 | 52 | def mousePressEvent(self, e): # 鼠标点击事件 53 | if e.button() == Qt.LeftButton: 54 | self.m_drag = True 55 | self.m_DragPosition = e.globalPosition().toPoint() - self.pos() 56 | e.accept() 57 | self.setCursor(QCursor(Qt.OpenHandCursor)) 58 | 59 | def mouseReleaseEvent(self, e): # 鼠标释放事件 60 | if e.button() == Qt.LeftButton: 61 | self.m_drag = False 62 | self.setCursor(QCursor(Qt.ArrowCursor)) 63 | 64 | def mouseMoveEvent(self, e): # 鼠标拖动事件 65 | if Qt.LeftButton and self.m_drag: 66 | self.move(e.globalPosition().toPoint() - self.m_DragPosition) 67 | e.accept() 68 | 69 | 70 | def get_tq_account(self): 71 | dict = {} 72 | # 如果main_tq_account不为空,则读取main_tq_account的值 73 | if (self.main_tq_account.text() is not None) and (self.main_tq_account.text() is not None): #如果帐户框和密码框都有都有输入 74 | 75 | self.ioModule.delete_file(path=self.path) #删除原文件 76 | self.ioModule.judge_file_exist(path=self.path) # 判断main_tq_account.csv是否存在,如果不存在,则创建 77 | dict['tq_account'] = self.main_tq_account.text() 78 | dict['qt_psd'] = self.main_tq_psd.text() 79 | self.parent.main_tq_account = self.main_tq_account.text() 80 | self.parent.main_tq__pwd = self.main_tq_psd.text() 81 | df = pd.DataFrame(dict, index=[0]) 82 | self.ioModule.add_dict_to_csv(df, path=self.path) 83 | # print(df) 84 | self.label_Account.setText('已配置主程序天勤帐号: ' + self.main_tq_account.text()) 85 | else: 86 | pass 87 | 88 | def clear_input(self): 89 | self.main_tq_account.clear() 90 | self.main_tq_psd.clear() 91 | 92 | def clear_main_tq_account(self): 93 | self.ioModule.delete_file(self.path) 94 | self.ioModule.judge_file_exist(path=self.path) 95 | self.label_Account.setText('天勤主账户已删除') -------------------------------------------------------------------------------- /UI/Delete_Warning_dark.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ################################################################################ 4 | ## Form generated from reading UI file 'Delete_Warning_dark.ui' 5 | ## 6 | ## Created by: Qt User Interface Compiler version 6.3.2 7 | ## 8 | ## WARNING! All changes made in this file will be lost when recompiling UI file! 9 | ################################################################################ 10 | 11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, 12 | QMetaObject, QObject, QPoint, QRect, 13 | QSize, QTime, QUrl, Qt) 14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, 15 | QFont, QFontDatabase, QGradient, QIcon, 16 | QImage, QKeySequence, QLinearGradient, QPainter, 17 | QPalette, QPixmap, QRadialGradient, QTransform) 18 | from PySide6.QtWidgets import (QApplication, QDialog, QFrame, QHBoxLayout, 19 | QLabel, QPushButton, QSizePolicy, QVBoxLayout, 20 | QWidget) 21 | 22 | class Ui_Dialog(object): 23 | def setupUi(self, Dialog): 24 | if not Dialog.objectName(): 25 | Dialog.setObjectName(u"Dialog") 26 | Dialog.resize(500, 250) 27 | Dialog.setMinimumSize(QSize(500, 250)) 28 | Dialog.setMaximumSize(QSize(500, 250)) 29 | self.frame = QFrame(Dialog) 30 | self.frame.setObjectName(u"frame") 31 | self.frame.setGeometry(QRect(0, 0, 500, 250)) 32 | self.frame.setMinimumSize(QSize(500, 250)) 33 | self.frame.setMaximumSize(QSize(500, 250)) 34 | self.frame.setStyleSheet(u"QFrame {\n" 35 | " background-color: rgb(13, 9, 36);\n" 36 | " border: 1px solid rgb(65, 51, 156);\n" 37 | " border-radius: 20px;\n" 38 | "}\n" 39 | "QFrame:hover {\n" 40 | " border: 2px solid rgb(255, 85, 0);\n" 41 | "}") 42 | self.frame.setFrameShape(QFrame.StyledPanel) 43 | self.frame.setFrameShadow(QFrame.Raised) 44 | self.verticalLayout = QVBoxLayout(self.frame) 45 | self.verticalLayout.setObjectName(u"verticalLayout") 46 | self.verticalLayout.setContentsMargins(-1, 20, -1, -1) 47 | self.frame_4 = QFrame(self.frame) 48 | self.frame_4.setObjectName(u"frame_4") 49 | self.frame_4.setStyleSheet(u"QFrame {\n" 50 | " border: none;\n" 51 | "}\n" 52 | "QFrame:hover {\n" 53 | " border: none;\n" 54 | "}") 55 | self.frame_4.setFrameShape(QFrame.StyledPanel) 56 | self.frame_4.setFrameShadow(QFrame.Raised) 57 | self.verticalLayout_2 = QVBoxLayout(self.frame_4) 58 | self.verticalLayout_2.setSpacing(10) 59 | self.verticalLayout_2.setObjectName(u"verticalLayout_2") 60 | self.verticalLayout_2.setContentsMargins(0, 20, 0, 10) 61 | self.label_tital_4 = QLabel(self.frame_4) 62 | self.label_tital_4.setObjectName(u"label_tital_4") 63 | self.label_tital_4.setMaximumSize(QSize(16777215, 50)) 64 | self.label_tital_4.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 65 | "color: rgb(255, 0, 127);\n" 66 | "border: none;") 67 | self.label_tital_4.setAlignment(Qt.AlignCenter) 68 | 69 | self.verticalLayout_2.addWidget(self.label_tital_4, 0, Qt.AlignHCenter) 70 | 71 | self.label = QLabel(self.frame_4) 72 | self.label.setObjectName(u"label") 73 | self.label.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 74 | "color: rgb(255, 0, 0);\n" 75 | "border: none;") 76 | self.label.setAlignment(Qt.AlignCenter) 77 | 78 | self.verticalLayout_2.addWidget(self.label) 79 | 80 | 81 | self.verticalLayout.addWidget(self.frame_4) 82 | 83 | self.frame_3 = QFrame(self.frame) 84 | self.frame_3.setObjectName(u"frame_3") 85 | self.frame_3.setMaximumSize(QSize(16777215, 60)) 86 | self.frame_3.setStyleSheet(u"QFrame {\n" 87 | " border: none;\n" 88 | "}\n" 89 | "QFrame:hover {\n" 90 | " border: none;\n" 91 | "}") 92 | self.frame_3.setFrameShape(QFrame.StyledPanel) 93 | self.frame_3.setFrameShadow(QFrame.Raised) 94 | self.horizontalLayout_3 = QHBoxLayout(self.frame_3) 95 | self.horizontalLayout_3.setSpacing(0) 96 | self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") 97 | self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) 98 | self.frame_39 = QFrame(self.frame_3) 99 | self.frame_39.setObjectName(u"frame_39") 100 | self.frame_39.setStyleSheet(u"QFrame {\n" 101 | " border: none;\n" 102 | "}\n" 103 | "") 104 | self.frame_39.setFrameShape(QFrame.StyledPanel) 105 | self.frame_39.setFrameShadow(QFrame.Raised) 106 | self.horizontalLayout_20 = QHBoxLayout(self.frame_39) 107 | self.horizontalLayout_20.setSpacing(0) 108 | self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") 109 | self.horizontalLayout_20.setContentsMargins(0, 0, 0, 0) 110 | self.Btn_determine_delete = QPushButton(self.frame_39) 111 | self.Btn_determine_delete.setObjectName(u"Btn_determine_delete") 112 | self.Btn_determine_delete.setEnabled(True) 113 | sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) 114 | sizePolicy.setHorizontalStretch(0) 115 | sizePolicy.setVerticalStretch(0) 116 | sizePolicy.setHeightForWidth(self.Btn_determine_delete.sizePolicy().hasHeightForWidth()) 117 | self.Btn_determine_delete.setSizePolicy(sizePolicy) 118 | self.Btn_determine_delete.setMinimumSize(QSize(180, 40)) 119 | self.Btn_determine_delete.setMaximumSize(QSize(180, 40)) 120 | self.Btn_determine_delete.setStyleSheet(u"QPushButton{ \n" 121 | " background-color: rgb(255, 0, 0);\n" 122 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 123 | " border-radius: 18px;\n" 124 | "}\n" 125 | "QPushButton:hover{\n" 126 | " border: 3px solid rgb(255, 200, 0); \n" 127 | "}\n" 128 | "QPushButton:pressed{\n" 129 | " color: green;\n" 130 | " border-color: blueviolet;\n" 131 | " background-color: rgb(85, 0, 255);\n" 132 | "}\n" 133 | "QPushButton:disabled{\n" 134 | " color: rgb(31, 31, 31);\n" 135 | " background-color: rgb(152, 152, 152);\n" 136 | "}") 137 | self.Btn_determine_delete.setIconSize(QSize(20, 20)) 138 | self.Btn_determine_delete.setCheckable(True) 139 | self.Btn_determine_delete.setChecked(False) 140 | 141 | self.horizontalLayout_20.addWidget(self.Btn_determine_delete, 0, Qt.AlignVCenter) 142 | 143 | 144 | self.horizontalLayout_3.addWidget(self.frame_39) 145 | 146 | self.frame_45 = QFrame(self.frame_3) 147 | self.frame_45.setObjectName(u"frame_45") 148 | self.frame_45.setStyleSheet(u"QFrame {\n" 149 | " border: none;\n" 150 | "}\n" 151 | "") 152 | self.frame_45.setFrameShape(QFrame.StyledPanel) 153 | self.frame_45.setFrameShadow(QFrame.Raised) 154 | self.horizontalLayout_30 = QHBoxLayout(self.frame_45) 155 | self.horizontalLayout_30.setSpacing(0) 156 | self.horizontalLayout_30.setObjectName(u"horizontalLayout_30") 157 | self.horizontalLayout_30.setContentsMargins(0, 0, 0, 0) 158 | self.Btn_cancel_delete = QPushButton(self.frame_45) 159 | self.Btn_cancel_delete.setObjectName(u"Btn_cancel_delete") 160 | self.Btn_cancel_delete.setEnabled(True) 161 | sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) 162 | sizePolicy1.setHorizontalStretch(0) 163 | sizePolicy1.setVerticalStretch(0) 164 | sizePolicy1.setHeightForWidth(self.Btn_cancel_delete.sizePolicy().hasHeightForWidth()) 165 | self.Btn_cancel_delete.setSizePolicy(sizePolicy1) 166 | self.Btn_cancel_delete.setMinimumSize(QSize(180, 40)) 167 | self.Btn_cancel_delete.setMaximumSize(QSize(180, 40)) 168 | self.Btn_cancel_delete.setStyleSheet(u"QPushButton{ \n" 169 | " background-color: rgb(0, 255, 0);\n" 170 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 171 | " border-radius: 18px;\n" 172 | "}\n" 173 | "QPushButton:hover{\n" 174 | " border: 3px solid rgb(255, 200, 0); \n" 175 | "}\n" 176 | "QPushButton:pressed{\n" 177 | " color: green;\n" 178 | " border-color: blueviolet;\n" 179 | " background-color: rgb(85, 0, 255);\n" 180 | "}\n" 181 | "QPushButton:disabled{\n" 182 | " color: rgb(31, 31, 31);\n" 183 | " background-color: rgb(152, 152, 152);\n" 184 | "}") 185 | self.Btn_cancel_delete.setIconSize(QSize(19, 20)) 186 | 187 | self.horizontalLayout_30.addWidget(self.Btn_cancel_delete, 0, Qt.AlignVCenter) 188 | 189 | 190 | self.horizontalLayout_3.addWidget(self.frame_45) 191 | 192 | 193 | self.verticalLayout.addWidget(self.frame_3) 194 | 195 | 196 | self.retranslateUi(Dialog) 197 | self.Btn_cancel_delete.clicked.connect(Dialog.close) 198 | self.Btn_determine_delete.clicked.connect(Dialog.close) 199 | 200 | QMetaObject.connectSlotsByName(Dialog) 201 | # setupUi 202 | 203 | def retranslateUi(self, Dialog): 204 | Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None)) 205 | self.label_tital_4.setText(QCoreApplication.translate("Dialog", u"\u5220\u9664\u540e\uff0c\u6b64\u9879\u4fe1\u606f\u5c06\u6c38\u8fdc\u4e22\u5931\uff0c\u65e0\u6cd5\u6062\u590d", None)) 206 | self.label.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u8981\u5220\u9664\uff1f", None)) 207 | self.Btn_determine_delete.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u5220\u9664", None)) 208 | self.Btn_cancel_delete.setText(QCoreApplication.translate("Dialog", u"\u53d6\u6d88", None)) 209 | # retranslateUi 210 | 211 | -------------------------------------------------------------------------------- /UI/Delete_Warning_light.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ################################################################################ 4 | ## Form generated from reading UI file 'Delete_Warning_light.ui' 5 | ## 6 | ## Created by: Qt User Interface Compiler version 6.3.2 7 | ## 8 | ## WARNING! All changes made in this file will be lost when recompiling UI file! 9 | ################################################################################ 10 | 11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, 12 | QMetaObject, QObject, QPoint, QRect, 13 | QSize, QTime, QUrl, Qt) 14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, 15 | QFont, QFontDatabase, QGradient, QIcon, 16 | QImage, QKeySequence, QLinearGradient, QPainter, 17 | QPalette, QPixmap, QRadialGradient, QTransform) 18 | from PySide6.QtWidgets import (QApplication, QDialog, QFrame, QHBoxLayout, 19 | QLabel, QPushButton, QSizePolicy, QVBoxLayout, 20 | QWidget) 21 | 22 | class Ui_Dialog(object): 23 | def setupUi(self, Dialog): 24 | if not Dialog.objectName(): 25 | Dialog.setObjectName(u"Dialog") 26 | Dialog.resize(500, 250) 27 | Dialog.setMinimumSize(QSize(500, 250)) 28 | Dialog.setMaximumSize(QSize(500, 250)) 29 | self.frame = QFrame(Dialog) 30 | self.frame.setObjectName(u"frame") 31 | self.frame.setGeometry(QRect(0, 0, 500, 250)) 32 | self.frame.setMinimumSize(QSize(500, 250)) 33 | self.frame.setMaximumSize(QSize(500, 250)) 34 | self.frame.setStyleSheet(u"QFrame {\n" 35 | " background-color: rgb(255, 255, 235);\n" 36 | " border: 1px solid rgb(100, 100, 100);\n" 37 | " border-radius: 20px;\n" 38 | "}\n" 39 | "QFrame:hover {\n" 40 | " border: 2px solid rgb(255, 85, 0);\n" 41 | "}") 42 | self.frame.setFrameShape(QFrame.StyledPanel) 43 | self.frame.setFrameShadow(QFrame.Raised) 44 | self.verticalLayout = QVBoxLayout(self.frame) 45 | self.verticalLayout.setObjectName(u"verticalLayout") 46 | self.verticalLayout.setContentsMargins(-1, 20, -1, -1) 47 | self.frame_4 = QFrame(self.frame) 48 | self.frame_4.setObjectName(u"frame_4") 49 | self.frame_4.setStyleSheet(u"QFrame {\n" 50 | " border: none;\n" 51 | "}\n" 52 | "QFrame:hover {\n" 53 | " border: none;\n" 54 | "}") 55 | self.frame_4.setFrameShape(QFrame.StyledPanel) 56 | self.frame_4.setFrameShadow(QFrame.Raised) 57 | self.verticalLayout_2 = QVBoxLayout(self.frame_4) 58 | self.verticalLayout_2.setSpacing(10) 59 | self.verticalLayout_2.setObjectName(u"verticalLayout_2") 60 | self.verticalLayout_2.setContentsMargins(0, 20, 0, 10) 61 | self.label_tital_4 = QLabel(self.frame_4) 62 | self.label_tital_4.setObjectName(u"label_tital_4") 63 | self.label_tital_4.setMaximumSize(QSize(16777215, 50)) 64 | self.label_tital_4.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 65 | "color: rgb(255, 0, 127);\n" 66 | "border: none;") 67 | self.label_tital_4.setAlignment(Qt.AlignCenter) 68 | 69 | self.verticalLayout_2.addWidget(self.label_tital_4, 0, Qt.AlignHCenter) 70 | 71 | self.label = QLabel(self.frame_4) 72 | self.label.setObjectName(u"label") 73 | self.label.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 74 | "color: rgb(255, 0, 0);\n" 75 | "border: none;") 76 | self.label.setAlignment(Qt.AlignCenter) 77 | 78 | self.verticalLayout_2.addWidget(self.label) 79 | 80 | 81 | self.verticalLayout.addWidget(self.frame_4) 82 | 83 | self.frame_3 = QFrame(self.frame) 84 | self.frame_3.setObjectName(u"frame_3") 85 | self.frame_3.setMaximumSize(QSize(16777215, 60)) 86 | self.frame_3.setStyleSheet(u"QFrame {\n" 87 | " border: none;\n" 88 | "}\n" 89 | "QFrame:hover {\n" 90 | " border: none;\n" 91 | "}") 92 | self.frame_3.setFrameShape(QFrame.StyledPanel) 93 | self.frame_3.setFrameShadow(QFrame.Raised) 94 | self.horizontalLayout_3 = QHBoxLayout(self.frame_3) 95 | self.horizontalLayout_3.setSpacing(0) 96 | self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") 97 | self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) 98 | self.frame_39 = QFrame(self.frame_3) 99 | self.frame_39.setObjectName(u"frame_39") 100 | self.frame_39.setStyleSheet(u"QFrame {\n" 101 | " border: none;\n" 102 | "}\n" 103 | "") 104 | self.frame_39.setFrameShape(QFrame.StyledPanel) 105 | self.frame_39.setFrameShadow(QFrame.Raised) 106 | self.horizontalLayout_20 = QHBoxLayout(self.frame_39) 107 | self.horizontalLayout_20.setSpacing(0) 108 | self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") 109 | self.horizontalLayout_20.setContentsMargins(0, 0, 0, 0) 110 | self.Btn_determine_delete = QPushButton(self.frame_39) 111 | self.Btn_determine_delete.setObjectName(u"Btn_determine_delete") 112 | self.Btn_determine_delete.setEnabled(True) 113 | sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) 114 | sizePolicy.setHorizontalStretch(0) 115 | sizePolicy.setVerticalStretch(0) 116 | sizePolicy.setHeightForWidth(self.Btn_determine_delete.sizePolicy().hasHeightForWidth()) 117 | self.Btn_determine_delete.setSizePolicy(sizePolicy) 118 | self.Btn_determine_delete.setMinimumSize(QSize(180, 40)) 119 | self.Btn_determine_delete.setMaximumSize(QSize(180, 40)) 120 | self.Btn_determine_delete.setStyleSheet(u"QPushButton{ \n" 121 | " background-color: rgb(255, 0, 0);\n" 122 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 123 | " border-radius: 18px;\n" 124 | "}\n" 125 | "QPushButton:hover{\n" 126 | " border: 3px solid rgb(255, 200, 0); \n" 127 | "}\n" 128 | "QPushButton:pressed{\n" 129 | " color: green;\n" 130 | " border-color: blueviolet;\n" 131 | " background-color: rgb(85, 0, 255);\n" 132 | "}\n" 133 | "QPushButton:disabled{\n" 134 | " color: rgb(31, 31, 31);\n" 135 | " background-color: rgb(152, 152, 152);\n" 136 | "}") 137 | self.Btn_determine_delete.setIconSize(QSize(20, 20)) 138 | self.Btn_determine_delete.setCheckable(True) 139 | self.Btn_determine_delete.setChecked(False) 140 | 141 | self.horizontalLayout_20.addWidget(self.Btn_determine_delete, 0, Qt.AlignVCenter) 142 | 143 | 144 | self.horizontalLayout_3.addWidget(self.frame_39) 145 | 146 | self.frame_45 = QFrame(self.frame_3) 147 | self.frame_45.setObjectName(u"frame_45") 148 | self.frame_45.setStyleSheet(u"QFrame {\n" 149 | " border: none;\n" 150 | "}\n" 151 | "") 152 | self.frame_45.setFrameShape(QFrame.StyledPanel) 153 | self.frame_45.setFrameShadow(QFrame.Raised) 154 | self.horizontalLayout_30 = QHBoxLayout(self.frame_45) 155 | self.horizontalLayout_30.setSpacing(0) 156 | self.horizontalLayout_30.setObjectName(u"horizontalLayout_30") 157 | self.horizontalLayout_30.setContentsMargins(0, 0, 0, 0) 158 | self.Btn_cancel_delete = QPushButton(self.frame_45) 159 | self.Btn_cancel_delete.setObjectName(u"Btn_cancel_delete") 160 | self.Btn_cancel_delete.setEnabled(True) 161 | sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) 162 | sizePolicy1.setHorizontalStretch(0) 163 | sizePolicy1.setVerticalStretch(0) 164 | sizePolicy1.setHeightForWidth(self.Btn_cancel_delete.sizePolicy().hasHeightForWidth()) 165 | self.Btn_cancel_delete.setSizePolicy(sizePolicy1) 166 | self.Btn_cancel_delete.setMinimumSize(QSize(180, 40)) 167 | self.Btn_cancel_delete.setMaximumSize(QSize(180, 40)) 168 | self.Btn_cancel_delete.setStyleSheet(u"QPushButton{ \n" 169 | " background-color: rgb(0, 255, 0);\n" 170 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 171 | " border-radius: 18px;\n" 172 | "}\n" 173 | "QPushButton:hover{\n" 174 | " border: 3px solid rgb(255, 200, 0); \n" 175 | "}\n" 176 | "QPushButton:pressed{\n" 177 | " color: green;\n" 178 | " border-color: blueviolet;\n" 179 | " background-color: rgb(85, 0, 255);\n" 180 | "}\n" 181 | "QPushButton:disabled{\n" 182 | " color: rgb(31, 31, 31);\n" 183 | " background-color: rgb(152, 152, 152);\n" 184 | "}") 185 | self.Btn_cancel_delete.setIconSize(QSize(19, 20)) 186 | 187 | self.horizontalLayout_30.addWidget(self.Btn_cancel_delete, 0, Qt.AlignVCenter) 188 | 189 | 190 | self.horizontalLayout_3.addWidget(self.frame_45) 191 | 192 | 193 | self.verticalLayout.addWidget(self.frame_3) 194 | 195 | 196 | self.retranslateUi(Dialog) 197 | self.Btn_cancel_delete.clicked.connect(Dialog.close) 198 | self.Btn_determine_delete.clicked.connect(Dialog.close) 199 | 200 | QMetaObject.connectSlotsByName(Dialog) 201 | # setupUi 202 | 203 | def retranslateUi(self, Dialog): 204 | Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None)) 205 | self.label_tital_4.setText(QCoreApplication.translate("Dialog", u"\u5220\u9664\u540e\uff0c\u6b64\u9879\u4fe1\u606f\u5c06\u6c38\u8fdc\u4e22\u5931\uff0c\u65e0\u6cd5\u6062\u590d", None)) 206 | self.label.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u8981\u5220\u9664\uff1f", None)) 207 | self.Btn_determine_delete.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u5220\u9664", None)) 208 | self.Btn_cancel_delete.setText(QCoreApplication.translate("Dialog", u"\u53d6\u6d88", None)) 209 | # retranslateUi 210 | 211 | -------------------------------------------------------------------------------- /UI/Exit_dialog_dark.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ################################################################################ 4 | ## Form generated from reading UI file 'Exit_dialog_dark.ui' 5 | ## 6 | ## Created by: Qt User Interface Compiler version 6.3.2 7 | ## 8 | ## WARNING! All changes made in this file will be lost when recompiling UI file! 9 | ################################################################################ 10 | 11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, 12 | QMetaObject, QObject, QPoint, QRect, 13 | QSize, QTime, QUrl, Qt) 14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, 15 | QFont, QFontDatabase, QGradient, QIcon, 16 | QImage, QKeySequence, QLinearGradient, QPainter, 17 | QPalette, QPixmap, QRadialGradient, QTransform) 18 | from PySide6.QtWidgets import (QApplication, QDialog, QFrame, QHBoxLayout, 19 | QLabel, QPushButton, QSizePolicy, QVBoxLayout, 20 | QWidget) 21 | 22 | class Ui_Dialog(object): 23 | def setupUi(self, Dialog): 24 | if not Dialog.objectName(): 25 | Dialog.setObjectName(u"Dialog") 26 | Dialog.resize(600, 250) 27 | Dialog.setMinimumSize(QSize(600, 250)) 28 | Dialog.setMaximumSize(QSize(600, 250)) 29 | self.horizontalLayout = QHBoxLayout(Dialog) 30 | self.horizontalLayout.setSpacing(0) 31 | self.horizontalLayout.setObjectName(u"horizontalLayout") 32 | self.horizontalLayout.setContentsMargins(0, 0, 0, 0) 33 | self.frame = QFrame(Dialog) 34 | self.frame.setObjectName(u"frame") 35 | self.frame.setMinimumSize(QSize(600, 250)) 36 | self.frame.setMaximumSize(QSize(600, 250)) 37 | self.frame.setStyleSheet(u"QFrame {\n" 38 | " background-color: rgb(13, 9, 36);\n" 39 | " border: 1px solid rgb(65, 51, 156);\n" 40 | " border-radius: 20px;\n" 41 | "}\n" 42 | "QFrame:hover {\n" 43 | " border: 2px solid rgb(255, 85, 0);\n" 44 | "}") 45 | self.frame.setFrameShape(QFrame.StyledPanel) 46 | self.frame.setFrameShadow(QFrame.Raised) 47 | self.verticalLayout = QVBoxLayout(self.frame) 48 | self.verticalLayout.setObjectName(u"verticalLayout") 49 | self.verticalLayout.setContentsMargins(-1, 20, -1, -1) 50 | self.frame_4 = QFrame(self.frame) 51 | self.frame_4.setObjectName(u"frame_4") 52 | self.frame_4.setStyleSheet(u"QFrame {\n" 53 | " background-color: rgb(13, 9, 36);\n" 54 | " border: none;\n" 55 | " border-radius: 15px;\n" 56 | "}\n" 57 | "QFrame:hover {\n" 58 | " border: none;\n" 59 | "}") 60 | self.frame_4.setFrameShape(QFrame.StyledPanel) 61 | self.frame_4.setFrameShadow(QFrame.Raised) 62 | self.verticalLayout_2 = QVBoxLayout(self.frame_4) 63 | self.verticalLayout_2.setSpacing(10) 64 | self.verticalLayout_2.setObjectName(u"verticalLayout_2") 65 | self.verticalLayout_2.setContentsMargins(0, 20, 0, 10) 66 | self.label_tital_4 = QLabel(self.frame_4) 67 | self.label_tital_4.setObjectName(u"label_tital_4") 68 | self.label_tital_4.setMaximumSize(QSize(16777215, 50)) 69 | self.label_tital_4.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 70 | "color: rgb(255, 0, 127);\n" 71 | "border: none;") 72 | self.label_tital_4.setAlignment(Qt.AlignCenter) 73 | 74 | self.verticalLayout_2.addWidget(self.label_tital_4, 0, Qt.AlignHCenter) 75 | 76 | self.label = QLabel(self.frame_4) 77 | self.label.setObjectName(u"label") 78 | self.label.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 79 | "color: rgb(255, 0, 0);\n" 80 | "border: none;") 81 | self.label.setAlignment(Qt.AlignCenter) 82 | 83 | self.verticalLayout_2.addWidget(self.label) 84 | 85 | 86 | self.verticalLayout.addWidget(self.frame_4) 87 | 88 | self.frame_3 = QFrame(self.frame) 89 | self.frame_3.setObjectName(u"frame_3") 90 | self.frame_3.setMaximumSize(QSize(16777215, 60)) 91 | self.frame_3.setStyleSheet(u"QFrame {\n" 92 | " background-color: rgb(13, 9, 36);\n" 93 | " border: none;\n" 94 | " border-radius: 15px;\n" 95 | "}\n" 96 | "QFrame:hover {\n" 97 | " border: none;\n" 98 | "}") 99 | self.frame_3.setFrameShape(QFrame.StyledPanel) 100 | self.frame_3.setFrameShadow(QFrame.Raised) 101 | self.horizontalLayout_3 = QHBoxLayout(self.frame_3) 102 | self.horizontalLayout_3.setSpacing(0) 103 | self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") 104 | self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) 105 | self.frame_39 = QFrame(self.frame_3) 106 | self.frame_39.setObjectName(u"frame_39") 107 | self.frame_39.setStyleSheet(u"QFrame {\n" 108 | " background-color: rgb(13, 9, 36);\n" 109 | " border: none;\n" 110 | " border-radius: 20px;\n" 111 | "}\n" 112 | "") 113 | self.frame_39.setFrameShape(QFrame.StyledPanel) 114 | self.frame_39.setFrameShadow(QFrame.Raised) 115 | self.horizontalLayout_20 = QHBoxLayout(self.frame_39) 116 | self.horizontalLayout_20.setSpacing(0) 117 | self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") 118 | self.horizontalLayout_20.setContentsMargins(0, 0, 0, 0) 119 | self.Btn_determine_exit = QPushButton(self.frame_39) 120 | self.Btn_determine_exit.setObjectName(u"Btn_determine_exit") 121 | self.Btn_determine_exit.setEnabled(True) 122 | sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) 123 | sizePolicy.setHorizontalStretch(0) 124 | sizePolicy.setVerticalStretch(0) 125 | sizePolicy.setHeightForWidth(self.Btn_determine_exit.sizePolicy().hasHeightForWidth()) 126 | self.Btn_determine_exit.setSizePolicy(sizePolicy) 127 | self.Btn_determine_exit.setMinimumSize(QSize(180, 40)) 128 | self.Btn_determine_exit.setMaximumSize(QSize(180, 40)) 129 | self.Btn_determine_exit.setStyleSheet(u"QPushButton{ \n" 130 | " background-color: rgb(255, 0, 0);\n" 131 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 132 | " border-radius: 18px;\n" 133 | "}\n" 134 | "QPushButton:hover{\n" 135 | " border: 3px solid rgb(255, 200, 0); \n" 136 | "}\n" 137 | "QPushButton:pressed{\n" 138 | " color: green;\n" 139 | " border-color: blueviolet;\n" 140 | " background-color: rgb(85, 0, 255);\n" 141 | "}\n" 142 | "QPushButton:disabled{\n" 143 | " color: rgb(31, 31, 31);\n" 144 | " background-color: rgb(152, 152, 152);\n" 145 | "}") 146 | self.Btn_determine_exit.setIconSize(QSize(20, 20)) 147 | self.Btn_determine_exit.setCheckable(True) 148 | self.Btn_determine_exit.setChecked(False) 149 | 150 | self.horizontalLayout_20.addWidget(self.Btn_determine_exit, 0, Qt.AlignVCenter) 151 | 152 | 153 | self.horizontalLayout_3.addWidget(self.frame_39) 154 | 155 | self.frame_45 = QFrame(self.frame_3) 156 | self.frame_45.setObjectName(u"frame_45") 157 | self.frame_45.setStyleSheet(u"QFrame {\n" 158 | " background-color: rgb(13, 9, 36);\n" 159 | " border: none;\n" 160 | " border-radius: 20px;\n" 161 | "}\n" 162 | "") 163 | self.frame_45.setFrameShape(QFrame.StyledPanel) 164 | self.frame_45.setFrameShadow(QFrame.Raised) 165 | self.horizontalLayout_30 = QHBoxLayout(self.frame_45) 166 | self.horizontalLayout_30.setSpacing(0) 167 | self.horizontalLayout_30.setObjectName(u"horizontalLayout_30") 168 | self.horizontalLayout_30.setContentsMargins(0, 0, 0, 0) 169 | self.Btn_cancel_exit = QPushButton(self.frame_45) 170 | self.Btn_cancel_exit.setObjectName(u"Btn_cancel_exit") 171 | self.Btn_cancel_exit.setEnabled(True) 172 | sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) 173 | sizePolicy1.setHorizontalStretch(0) 174 | sizePolicy1.setVerticalStretch(0) 175 | sizePolicy1.setHeightForWidth(self.Btn_cancel_exit.sizePolicy().hasHeightForWidth()) 176 | self.Btn_cancel_exit.setSizePolicy(sizePolicy1) 177 | self.Btn_cancel_exit.setMinimumSize(QSize(180, 40)) 178 | self.Btn_cancel_exit.setMaximumSize(QSize(180, 40)) 179 | self.Btn_cancel_exit.setStyleSheet(u"QPushButton{ \n" 180 | " background-color: rgb(0, 255, 0);\n" 181 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 182 | " border-radius: 20px;\n" 183 | "}\n" 184 | "QPushButton:hover{\n" 185 | " border: 3px solid rgb(255, 200, 0); \n" 186 | "}\n" 187 | "QPushButton:pressed{\n" 188 | " color: green;\n" 189 | " border-color: rgb(255, 0, 0);\n" 190 | " background-color: rgb(255, 255, 0);\n" 191 | "}\n" 192 | "QPushButton:disabled{\n" 193 | " color: rgb(31, 31, 31);\n" 194 | " background-color: rgb(152, 152, 152);\n" 195 | "}") 196 | self.Btn_cancel_exit.setIconSize(QSize(19, 20)) 197 | 198 | self.horizontalLayout_30.addWidget(self.Btn_cancel_exit, 0, Qt.AlignVCenter) 199 | 200 | 201 | self.horizontalLayout_3.addWidget(self.frame_45) 202 | 203 | 204 | self.verticalLayout.addWidget(self.frame_3) 205 | 206 | 207 | self.horizontalLayout.addWidget(self.frame) 208 | 209 | 210 | self.retranslateUi(Dialog) 211 | self.Btn_cancel_exit.clicked.connect(Dialog.close) 212 | 213 | QMetaObject.connectSlotsByName(Dialog) 214 | # setupUi 215 | 216 | def retranslateUi(self, Dialog): 217 | Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None)) 218 | self.label_tital_4.setText(QCoreApplication.translate("Dialog", u"\u9000\u51fa\u540e\uff0c\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u7b56\u7565\u90fd\u5c06\u4f1a\u5173\u95ed\u3002", None)) 219 | self.label.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u8981\u9000\u51fa\uff1f", None)) 220 | self.Btn_determine_exit.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u9000\u51fa", None)) 221 | self.Btn_cancel_exit.setText(QCoreApplication.translate("Dialog", u"\u53d6\u6d88\u9000\u51fa", None)) 222 | # retranslateUi 223 | 224 | -------------------------------------------------------------------------------- /UI/Exit_dialog_light.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ################################################################################ 4 | ## Form generated from reading UI file 'Exit_dialog_light.ui' 5 | ## 6 | ## Created by: Qt User Interface Compiler version 6.3.2 7 | ## 8 | ## WARNING! All changes made in this file will be lost when recompiling UI file! 9 | ################################################################################ 10 | 11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, 12 | QMetaObject, QObject, QPoint, QRect, 13 | QSize, QTime, QUrl, Qt) 14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, 15 | QFont, QFontDatabase, QGradient, QIcon, 16 | QImage, QKeySequence, QLinearGradient, QPainter, 17 | QPalette, QPixmap, QRadialGradient, QTransform) 18 | from PySide6.QtWidgets import (QApplication, QDialog, QFrame, QHBoxLayout, 19 | QLabel, QPushButton, QSizePolicy, QVBoxLayout, 20 | QWidget) 21 | 22 | class Ui_Dialog(object): 23 | def setupUi(self, Dialog): 24 | if not Dialog.objectName(): 25 | Dialog.setObjectName(u"Dialog") 26 | Dialog.resize(600, 250) 27 | Dialog.setMinimumSize(QSize(600, 250)) 28 | Dialog.setMaximumSize(QSize(600, 250)) 29 | self.horizontalLayout = QHBoxLayout(Dialog) 30 | self.horizontalLayout.setSpacing(0) 31 | self.horizontalLayout.setObjectName(u"horizontalLayout") 32 | self.horizontalLayout.setContentsMargins(0, 0, 0, 0) 33 | self.frame = QFrame(Dialog) 34 | self.frame.setObjectName(u"frame") 35 | self.frame.setMinimumSize(QSize(600, 250)) 36 | self.frame.setMaximumSize(QSize(600, 250)) 37 | self.frame.setStyleSheet(u"QFrame {\n" 38 | " background-color: rgb(255, 255, 255);\n" 39 | " border: 1px solid rgb(65, 51, 156);\n" 40 | " border-radius: 20px;\n" 41 | "}\n" 42 | "QFrame:hover {\n" 43 | " border: 2px solid rgb(255, 85, 0);\n" 44 | "}") 45 | self.frame.setFrameShape(QFrame.StyledPanel) 46 | self.frame.setFrameShadow(QFrame.Raised) 47 | self.verticalLayout = QVBoxLayout(self.frame) 48 | self.verticalLayout.setObjectName(u"verticalLayout") 49 | self.verticalLayout.setContentsMargins(-1, 9, -1, -1) 50 | self.frame_4 = QFrame(self.frame) 51 | self.frame_4.setObjectName(u"frame_4") 52 | self.frame_4.setStyleSheet(u"QFrame {\n" 53 | " background-color: rgb(255, 240, 240);\n" 54 | " border: none;\n" 55 | " border-radius: 15px;\n" 56 | "}\n" 57 | "QFrame:hover {\n" 58 | " border: none;\n" 59 | "}") 60 | self.frame_4.setFrameShape(QFrame.StyledPanel) 61 | self.frame_4.setFrameShadow(QFrame.Raised) 62 | self.verticalLayout_2 = QVBoxLayout(self.frame_4) 63 | self.verticalLayout_2.setSpacing(10) 64 | self.verticalLayout_2.setObjectName(u"verticalLayout_2") 65 | self.verticalLayout_2.setContentsMargins(0, 20, 0, 10) 66 | self.label_tital_4 = QLabel(self.frame_4) 67 | self.label_tital_4.setObjectName(u"label_tital_4") 68 | self.label_tital_4.setMaximumSize(QSize(16777215, 50)) 69 | self.label_tital_4.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 70 | "color: rgb(255, 0, 127);\n" 71 | "border: none;") 72 | self.label_tital_4.setAlignment(Qt.AlignCenter) 73 | 74 | self.verticalLayout_2.addWidget(self.label_tital_4, 0, Qt.AlignHCenter) 75 | 76 | self.label = QLabel(self.frame_4) 77 | self.label.setObjectName(u"label") 78 | self.label.setStyleSheet(u"font: 700 18pt \"\u7b49\u7ebf\";\n" 79 | "color: rgb(255, 0, 0);\n" 80 | "border: none;") 81 | self.label.setAlignment(Qt.AlignCenter) 82 | 83 | self.verticalLayout_2.addWidget(self.label) 84 | 85 | 86 | self.verticalLayout.addWidget(self.frame_4) 87 | 88 | self.frame_3 = QFrame(self.frame) 89 | self.frame_3.setObjectName(u"frame_3") 90 | self.frame_3.setMaximumSize(QSize(16777215, 60)) 91 | self.frame_3.setStyleSheet(u"QFrame {\n" 92 | " background-color: rgb(240, 255, 255);\n" 93 | " border: none;\n" 94 | " border-radius: 15px;\n" 95 | "}\n" 96 | "QFrame:hover {\n" 97 | " border: none;\n" 98 | "}") 99 | self.frame_3.setFrameShape(QFrame.StyledPanel) 100 | self.frame_3.setFrameShadow(QFrame.Raised) 101 | self.horizontalLayout_3 = QHBoxLayout(self.frame_3) 102 | self.horizontalLayout_3.setSpacing(0) 103 | self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") 104 | self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) 105 | self.frame_39 = QFrame(self.frame_3) 106 | self.frame_39.setObjectName(u"frame_39") 107 | self.frame_39.setStyleSheet(u"QFrame {\n" 108 | " border: none;\n" 109 | " border-radius: 20px;\n" 110 | "}\n" 111 | "") 112 | self.frame_39.setFrameShape(QFrame.StyledPanel) 113 | self.frame_39.setFrameShadow(QFrame.Raised) 114 | self.horizontalLayout_20 = QHBoxLayout(self.frame_39) 115 | self.horizontalLayout_20.setSpacing(0) 116 | self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") 117 | self.horizontalLayout_20.setContentsMargins(0, 0, 0, 0) 118 | self.Btn_determine_exit = QPushButton(self.frame_39) 119 | self.Btn_determine_exit.setObjectName(u"Btn_determine_exit") 120 | self.Btn_determine_exit.setEnabled(True) 121 | sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) 122 | sizePolicy.setHorizontalStretch(0) 123 | sizePolicy.setVerticalStretch(0) 124 | sizePolicy.setHeightForWidth(self.Btn_determine_exit.sizePolicy().hasHeightForWidth()) 125 | self.Btn_determine_exit.setSizePolicy(sizePolicy) 126 | self.Btn_determine_exit.setMinimumSize(QSize(180, 40)) 127 | self.Btn_determine_exit.setMaximumSize(QSize(180, 40)) 128 | self.Btn_determine_exit.setStyleSheet(u"QPushButton{ \n" 129 | " background-color: rgb(255, 0, 0);\n" 130 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 131 | " border-radius: 18px;\n" 132 | "}\n" 133 | "QPushButton:hover{\n" 134 | " border: 3px solid rgb(255, 200, 0); \n" 135 | "}\n" 136 | "QPushButton:pressed{\n" 137 | " color: green;\n" 138 | " border-color: blueviolet;\n" 139 | " background-color: rgb(85, 0, 255);\n" 140 | "}\n" 141 | "QPushButton:disabled{\n" 142 | " color: rgb(31, 31, 31);\n" 143 | " background-color: rgb(152, 152, 152);\n" 144 | "}") 145 | self.Btn_determine_exit.setIconSize(QSize(20, 20)) 146 | self.Btn_determine_exit.setCheckable(True) 147 | self.Btn_determine_exit.setChecked(False) 148 | 149 | self.horizontalLayout_20.addWidget(self.Btn_determine_exit, 0, Qt.AlignVCenter) 150 | 151 | 152 | self.horizontalLayout_3.addWidget(self.frame_39) 153 | 154 | self.frame_45 = QFrame(self.frame_3) 155 | self.frame_45.setObjectName(u"frame_45") 156 | self.frame_45.setStyleSheet(u"QFrame {\n" 157 | " border: none;\n" 158 | " border-radius: 20px;\n" 159 | "}\n" 160 | "") 161 | self.frame_45.setFrameShape(QFrame.StyledPanel) 162 | self.frame_45.setFrameShadow(QFrame.Raised) 163 | self.horizontalLayout_30 = QHBoxLayout(self.frame_45) 164 | self.horizontalLayout_30.setSpacing(0) 165 | self.horizontalLayout_30.setObjectName(u"horizontalLayout_30") 166 | self.horizontalLayout_30.setContentsMargins(0, 0, 0, 0) 167 | self.Btn_cancel_exit = QPushButton(self.frame_45) 168 | self.Btn_cancel_exit.setObjectName(u"Btn_cancel_exit") 169 | self.Btn_cancel_exit.setEnabled(True) 170 | sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) 171 | sizePolicy1.setHorizontalStretch(0) 172 | sizePolicy1.setVerticalStretch(0) 173 | sizePolicy1.setHeightForWidth(self.Btn_cancel_exit.sizePolicy().hasHeightForWidth()) 174 | self.Btn_cancel_exit.setSizePolicy(sizePolicy1) 175 | self.Btn_cancel_exit.setMinimumSize(QSize(180, 40)) 176 | self.Btn_cancel_exit.setMaximumSize(QSize(180, 40)) 177 | self.Btn_cancel_exit.setStyleSheet(u"QPushButton{ \n" 178 | " background-color: rgb(0, 255, 0);\n" 179 | " font: 700 18pt \"\u7b49\u7ebf\";\n" 180 | " border-radius: 20px;\n" 181 | "}\n" 182 | "QPushButton:hover{\n" 183 | " border: 3px solid rgb(255, 200, 0); \n" 184 | "}\n" 185 | "QPushButton:pressed{\n" 186 | " color: green;\n" 187 | " border-color: rgb(255, 0, 0);\n" 188 | " background-color: rgb(255, 255, 0);\n" 189 | "}\n" 190 | "QPushButton:disabled{\n" 191 | " color: rgb(31, 31, 31);\n" 192 | " background-color: rgb(152, 152, 152);\n" 193 | "}") 194 | self.Btn_cancel_exit.setIconSize(QSize(19, 20)) 195 | 196 | self.horizontalLayout_30.addWidget(self.Btn_cancel_exit, 0, Qt.AlignVCenter) 197 | 198 | 199 | self.horizontalLayout_3.addWidget(self.frame_45) 200 | 201 | 202 | self.verticalLayout.addWidget(self.frame_3) 203 | 204 | 205 | self.horizontalLayout.addWidget(self.frame) 206 | 207 | 208 | self.retranslateUi(Dialog) 209 | self.Btn_cancel_exit.clicked.connect(Dialog.close) 210 | 211 | QMetaObject.connectSlotsByName(Dialog) 212 | # setupUi 213 | 214 | def retranslateUi(self, Dialog): 215 | Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None)) 216 | self.label_tital_4.setText(QCoreApplication.translate("Dialog", u"\u9000\u51fa\u540e\uff0c\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u7b56\u7565\u90fd\u5c06\u4f1a\u5173\u95ed\u3002", None)) 217 | self.label.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u8981\u9000\u51fa\uff1f", None)) 218 | self.Btn_determine_exit.setText(QCoreApplication.translate("Dialog", u"\u786e\u5b9a\u9000\u51fa", None)) 219 | self.Btn_cancel_exit.setText(QCoreApplication.translate("Dialog", u"\u53d6\u6d88\u9000\u51fa", None)) 220 | # retranslateUi 221 | 222 | -------------------------------------------------------------------------------- /__pycache__/CreateBackTestProcess.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/CreateBackTestProcess.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/CreateBackTestWindow.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/CreateBackTestWindow.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/CreateNewProcess.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/CreateNewProcess.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/CreateNewProcessWindow.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/CreateNewProcessWindow.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/Donation.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/Donation.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/DonationWindow.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/DonationWindow.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/ExitDialogWindow.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/ExitDialogWindow.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/Exit_dialog.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/Exit_dialog.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/MainWindowUI.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/MainWindowUI.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/Main_Process_Function.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/Main_Process_Function.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/ReSetUI.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/ReSetUI.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteCreateBackTestProcess.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteCreateBackTestProcess.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteCreateNewProcess.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteCreateNewProcess.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteDonation.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteDonation.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteExitDialog.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteExitDialog.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteMainWindows.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteMainWindows.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/RewriteSetting.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/RewriteSetting.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/Setting.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/Setting.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/dtview.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/dtview.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/mainwindows.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/mainwindows.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/read_write_file.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/read_write_file.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/resource_rc.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/resource_rc.cpython-310.pyc -------------------------------------------------------------------------------- /__pycache__/resourse_rc.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/__pycache__/resourse_rc.cpython-310.pyc -------------------------------------------------------------------------------- /available_contracts/CFFEX_Cont.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.m@CFFEX.IF 3 | 1,KQ.m@CFFEX.T 4 | 2,KQ.m@CFFEX.TS 5 | 3,KQ.m@CFFEX.IC 6 | 4,KQ.m@CFFEX.IM 7 | 5,KQ.m@CFFEX.IH 8 | 6,KQ.m@CFFEX.TF 9 | -------------------------------------------------------------------------------- /available_contracts/CFFEX_Future.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,CFFEX.TF2203 3 | 1,CFFEX.IF2205 4 | 2,CFFEX.IC2203 5 | 3,CFFEX.IH2105 6 | 4,CFFEX.IF2105 7 | 5,CFFEX.IC2012 8 | 6,CFFEX.T2303 9 | 7,CFFEX.IF2101 10 | 8,CFFEX.IM2208 11 | 9,CFFEX.IF2208 12 | 10,CFFEX.IF2206 13 | 11,CFFEX.IH2208 14 | 12,CFFEX.IH2210 15 | 13,CFFEX.IC2104 16 | 14,CFFEX.IC2206 17 | 15,CFFEX.IH2212 18 | 16,CFFEX.IF2212 19 | 17,CFFEX.IH2108 20 | 18,CFFEX.T2212 21 | 19,CFFEX.IH2109 22 | 20,CFFEX.TF2103 23 | 21,CFFEX.TS2209 24 | 22,CFFEX.IH2112 25 | 23,CFFEX.TF2112 26 | 24,CFFEX.IH2202 27 | 25,CFFEX.IC2211 28 | 26,CFFEX.IH2209 29 | 27,CFFEX.IF2210 30 | 28,CFFEX.IM2211 31 | 29,CFFEX.TS2203 32 | 30,CFFEX.IH2111 33 | 31,CFFEX.IH2110 34 | 32,CFFEX.IF2204 35 | 33,CFFEX.IF2102 36 | 34,CFFEX.IF2009 37 | 35,CFFEX.IC2103 38 | 36,CFFEX.IF2203 39 | 37,CFFEX.IM2210 40 | 38,CFFEX.IH2009 41 | 39,CFFEX.IH2205 42 | 40,CFFEX.IC2107 43 | 41,CFFEX.TF2209 44 | 42,CFFEX.IH2103 45 | 43,CFFEX.IC2201 46 | 44,CFFEX.TS2012 47 | 45,CFFEX.T2206 48 | 46,CFFEX.IF2211 49 | 47,CFFEX.TS2303 50 | 48,CFFEX.IC2102 51 | 49,CFFEX.T2109 52 | 50,CFFEX.IC2105 53 | 51,CFFEX.T2112 54 | 52,CFFEX.TS2106 55 | 53,CFFEX.IH2011 56 | 54,CFFEX.IC2212 57 | 55,CFFEX.IH2101 58 | 56,CFFEX.IC2106 59 | 57,CFFEX.IF2012 60 | 58,CFFEX.TS2112 61 | 59,CFFEX.IC2010 62 | 60,CFFEX.IC2210 63 | 61,CFFEX.TF2306 64 | 62,CFFEX.IC2209 65 | 63,CFFEX.IF2303 66 | 64,CFFEX.IC2111 67 | 65,CFFEX.IH2203 68 | 66,CFFEX.T2106 69 | 67,CFFEX.IF2106 70 | 68,CFFEX.IH2102 71 | 69,CFFEX.IF2112 72 | 70,CFFEX.IC2108 73 | 71,CFFEX.TS2212 74 | 72,CFFEX.IC2205 75 | 73,CFFEX.T2209 76 | 74,CFFEX.TF2206 77 | 75,CFFEX.TF2109 78 | 76,CFFEX.T2103 79 | 77,CFFEX.IM2209 80 | 78,CFFEX.IH2204 81 | 79,CFFEX.IH2201 82 | 80,CFFEX.IF2108 83 | 81,CFFEX.IC2009 84 | 82,CFFEX.TF2106 85 | 83,CFFEX.IF2201 86 | 84,CFFEX.IF2107 87 | 85,CFFEX.IH2107 88 | 86,CFFEX.IC2303 89 | 87,CFFEX.IF2110 90 | 88,CFFEX.IC2101 91 | 89,CFFEX.IF2202 92 | 90,CFFEX.IM2303 93 | 91,CFFEX.T2306 94 | 92,CFFEX.IC2207 95 | 93,CFFEX.IH2104 96 | 94,CFFEX.TF2012 97 | 95,CFFEX.IC2109 98 | 96,CFFEX.IF2103 99 | 97,CFFEX.IH2211 100 | 98,CFFEX.IF2207 101 | 99,CFFEX.IH2010 102 | 100,CFFEX.TF2212 103 | 101,CFFEX.IC2202 104 | 102,CFFEX.IF2011 105 | 103,CFFEX.IM2212 106 | 104,CFFEX.TS2103 107 | 105,CFFEX.IF2209 108 | 106,CFFEX.IC2112 109 | 107,CFFEX.TS2206 110 | 108,CFFEX.TS2109 111 | 109,CFFEX.IH2106 112 | 110,CFFEX.IC2208 113 | 111,CFFEX.IC2110 114 | 112,CFFEX.IH2012 115 | 113,CFFEX.IF2109 116 | 114,CFFEX.IH2207 117 | 115,CFFEX.TS2306 118 | 116,CFFEX.T2012 119 | 117,CFFEX.IH2206 120 | 118,CFFEX.IC2204 121 | 119,CFFEX.IC2011 122 | 120,CFFEX.IH2303 123 | 121,CFFEX.T2203 124 | 122,CFFEX.TF2303 125 | 123,CFFEX.IF2111 126 | 124,CFFEX.IF2104 127 | 125,CFFEX.IF2010 128 | -------------------------------------------------------------------------------- /available_contracts/CFFEX_Index.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.i@CFFEX.IF 3 | 1,KQ.i@CFFEX.IC 4 | 2,KQ.i@CFFEX.TF 5 | 3,KQ.i@CFFEX.IM 6 | 4,KQ.i@CFFEX.TS 7 | 5,KQ.i@CFFEX.IH 8 | 6,KQ.i@CFFEX.T 9 | -------------------------------------------------------------------------------- /available_contracts/CFFEX_Main.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,CFFEX.IH2210 3 | 1,CFFEX.IM2210 4 | 2,CFFEX.TS2212 5 | 3,CFFEX.IF2210 6 | 4,CFFEX.TF2212 7 | 5,CFFEX.IC2210 8 | 6,CFFEX.T2212 9 | -------------------------------------------------------------------------------- /available_contracts/CZCE_Cont.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.m@CZCE.SR 3 | 1,KQ.m@CZCE.MA 4 | 2,KQ.m@CZCE.PF 5 | 3,KQ.m@CZCE.SA 6 | 4,KQ.m@CZCE.TA 7 | 5,KQ.m@CZCE.FG 8 | 6,KQ.m@CZCE.PM 9 | 7,KQ.m@CZCE.ZC 10 | 8,KQ.m@CZCE.UR 11 | 9,KQ.m@CZCE.LR 12 | 10,KQ.m@CZCE.RM 13 | 11,KQ.m@CZCE.WH 14 | 12,KQ.m@CZCE.CJ 15 | 13,KQ.m@CZCE.SM 16 | 14,KQ.m@CZCE.CF 17 | 15,KQ.m@CZCE.AP 18 | 16,KQ.m@CZCE.CY 19 | 17,KQ.m@CZCE.SF 20 | 18,KQ.m@CZCE.RS 21 | 19,KQ.m@CZCE.RI 22 | 20,KQ.m@CZCE.JR 23 | 21,KQ.m@CZCE.OI 24 | 22,KQ.m@CZCE.PK 25 | -------------------------------------------------------------------------------- /available_contracts/CZCE_Future.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,CZCE.PM201 3 | 1,CZCE.JR209 4 | 2,CZCE.JR105 5 | 3,CZCE.CF305 6 | 4,CZCE.WH107 7 | 5,CZCE.TA209 8 | 6,CZCE.SF011 9 | 7,CZCE.TA304 10 | 8,CZCE.PF211 11 | 9,CZCE.OI103 12 | 10,CZCE.FG205 13 | 11,CZCE.LR305 14 | 12,CZCE.MA111 15 | 13,CZCE.AP212 16 | 14,CZCE.PM303 17 | 15,CZCE.CY112 18 | 16,CZCE.SA012 19 | 17,CZCE.CF107 20 | 18,CZCE.RS109 21 | 19,CZCE.MA303 22 | 20,CZCE.PF302 23 | 21,CZCE.UR206 24 | 22,CZCE.UR210 25 | 23,CZCE.JR103 26 | 24,CZCE.UR211 27 | 25,CZCE.ZC112 28 | 26,CZCE.SM210 29 | 27,CZCE.FG203 30 | 28,CZCE.RM109 31 | 29,CZCE.UR303 32 | 30,CZCE.RI209 33 | 31,CZCE.ZC309 34 | 32,CZCE.CY210 35 | 33,CZCE.SF106 36 | 34,CZCE.FG211 37 | 35,CZCE.CY202 38 | 36,CZCE.SF107 39 | 37,CZCE.RI307 40 | 38,CZCE.OI309 41 | 39,CZCE.CJ103 42 | 40,CZCE.PF108 43 | 41,CZCE.CJ212 44 | 42,CZCE.UR109 45 | 43,CZCE.CY211 46 | 44,CZCE.FG301 47 | 45,CZCE.PF106 48 | 46,CZCE.UR306 49 | 47,CZCE.UR112 50 | 48,CZCE.SA204 51 | 49,CZCE.CY212 52 | 50,CZCE.CF207 53 | 51,CZCE.MA104 54 | 52,CZCE.CF303 55 | 53,CZCE.SR303 56 | 54,CZCE.JR211 57 | 55,CZCE.SR301 58 | 56,CZCE.SM308 59 | 57,CZCE.MA305 60 | 58,CZCE.FG106 61 | 59,CZCE.SA011 62 | 60,CZCE.SR105 63 | 61,CZCE.UR103 64 | 62,CZCE.CF307 65 | 63,CZCE.ZC310 66 | 64,CZCE.WH211 67 | 65,CZCE.TA011 68 | 66,CZCE.RM207 69 | 67,CZCE.LR011 70 | 68,CZCE.AP301 71 | 69,CZCE.WH305 72 | 70,CZCE.AP304 73 | 71,CZCE.FG104 74 | 72,CZCE.FG010 75 | 73,CZCE.PK201 76 | 74,CZCE.CY201 77 | 75,CZCE.UR309 78 | 76,CZCE.CY302 79 | 77,CZCE.ZC101 80 | 78,CZCE.MA211 81 | 79,CZCE.RS211 82 | 80,CZCE.ZC108 83 | 81,CZCE.SM307 84 | 82,CZCE.SA201 85 | 83,CZCE.SF203 86 | 84,CZCE.RS208 87 | 85,CZCE.LR309 88 | 86,CZCE.PF212 89 | 87,CZCE.FG306 90 | 88,CZCE.ZC209 91 | 89,CZCE.MA206 92 | 90,CZCE.CJ201 93 | 91,CZCE.MA108 94 | 92,CZCE.OI209 95 | 93,CZCE.LR211 96 | 94,CZCE.OI307 97 | 95,CZCE.SA208 98 | 96,CZCE.PK211 99 | 97,CZCE.RS111 100 | 98,CZCE.AP201 101 | 99,CZCE.UR010 102 | 100,CZCE.CF205 103 | 101,CZCE.JR107 104 | 102,CZCE.SM112 105 | 103,CZCE.ZC211 106 | 104,CZCE.SA107 107 | 105,CZCE.CJ207 108 | 106,CZCE.PF111 109 | 107,CZCE.SM205 110 | 108,CZCE.SF111 111 | 109,CZCE.SF109 112 | 110,CZCE.SF101 113 | 111,CZCE.PF208 114 | 112,CZCE.CF301 115 | 113,CZCE.FG011 116 | 114,CZCE.CF309 117 | 115,CZCE.RI305 118 | 116,CZCE.FG201 119 | 117,CZCE.CF201 120 | 118,CZCE.ZC104 121 | 119,CZCE.ZC111 122 | 120,CZCE.AP012 123 | 121,CZCE.SM302 124 | 122,CZCE.MA307 125 | 123,CZCE.FG107 126 | 124,CZCE.SA207 127 | 125,CZCE.FG102 128 | 126,CZCE.FG103 129 | 127,CZCE.SF208 130 | 128,CZCE.SR209 131 | 129,CZCE.SA110 132 | 130,CZCE.MA201 133 | 131,CZCE.RS209 134 | 132,CZCE.ZC109 135 | 133,CZCE.RM011 136 | 134,CZCE.ZC210 137 | 135,CZCE.MA304 138 | 136,CZCE.PK303 139 | 137,CZCE.UR203 140 | 138,CZCE.ZC201 141 | 139,CZCE.CF109 142 | 140,CZCE.SA302 143 | 141,CZCE.AP305 144 | 142,CZCE.RM205 145 | 143,CZCE.FG212 146 | 144,CZCE.SM104 147 | 145,CZCE.FG012 148 | 146,CZCE.PM205 149 | 147,CZCE.JR207 150 | 148,CZCE.ZC202 151 | 149,CZCE.FG108 152 | 150,CZCE.RI303 153 | 151,CZCE.UR106 154 | 152,CZCE.SM011 155 | 153,CZCE.OI011 156 | 154,CZCE.PF306 157 | 155,CZCE.SF301 158 | 156,CZCE.WH105 159 | 157,CZCE.SF103 160 | 158,CZCE.CJ112 161 | 159,CZCE.PK301 162 | 160,CZCE.PK110 163 | 161,CZCE.CY204 164 | 162,CZCE.FG302 165 | 163,CZCE.ZC308 166 | 164,CZCE.TA104 167 | 165,CZCE.TA204 168 | 166,CZCE.RI203 169 | 167,CZCE.CY106 170 | 168,CZCE.SM111 171 | 169,CZCE.CY109 172 | 170,CZCE.OI207 173 | 171,CZCE.MA208 174 | 172,CZCE.ZC207 175 | 173,CZCE.RS107 176 | 174,CZCE.TA111 177 | 175,CZCE.TA303 178 | 176,CZCE.SF201 179 | 177,CZCE.AP204 180 | 178,CZCE.PF308 181 | 179,CZCE.CJ107 182 | 180,CZCE.UR208 183 | 181,CZCE.PF105 184 | 182,CZCE.RS108 185 | 183,CZCE.JR203 186 | 184,CZCE.PM309 187 | 185,CZCE.AP112 188 | 186,CZCE.CY110 189 | 187,CZCE.RI109 190 | 188,CZCE.SA109 191 | 189,CZCE.OI305 192 | 190,CZCE.PF203 193 | 191,CZCE.SF304 194 | 192,CZCE.CY305 195 | 193,CZCE.RM201 196 | 194,CZCE.SM212 197 | 195,CZCE.WH109 198 | 196,CZCE.MA101 199 | 197,CZCE.JR303 200 | 198,CZCE.TA212 201 | 199,CZCE.PF205 202 | 200,CZCE.CY111 203 | 201,CZCE.ZC302 204 | 202,CZCE.SM202 205 | 203,CZCE.RI111 206 | 204,CZCE.SA304 207 | 205,CZCE.WH011 208 | 206,CZCE.SA209 209 | 207,CZCE.PF202 210 | 208,CZCE.PF112 211 | 209,CZCE.SF206 212 | 210,CZCE.SF204 213 | 211,CZCE.TA205 214 | 212,CZCE.RI105 215 | 213,CZCE.PF206 216 | 214,CZCE.SF105 217 | 215,CZCE.SM206 218 | 216,CZCE.SA105 219 | 217,CZCE.JR205 220 | 218,CZCE.RM203 221 | 219,CZCE.SF202 222 | 220,CZCE.PM011 223 | 221,CZCE.AP210 224 | 222,CZCE.ZC107 225 | 223,CZCE.CY207 226 | 224,CZCE.LR203 227 | 225,CZCE.ZC212 228 | 226,CZCE.SF308 229 | 227,CZCE.JR305 230 | 228,CZCE.CY105 231 | 229,CZCE.UR302 232 | 230,CZCE.TA107 233 | 231,CZCE.RS011 234 | 232,CZCE.MA308 235 | 233,CZCE.CF103 236 | 234,CZCE.CF203 237 | 235,CZCE.AP111 238 | 236,CZCE.PM103 239 | 237,CZCE.RM111 240 | 238,CZCE.LR201 241 | 239,CZCE.FG304 242 | 240,CZCE.ZC105 243 | 241,CZCE.WH101 244 | 242,CZCE.SR107 245 | 243,CZCE.OI107 246 | 244,CZCE.SM207 247 | 245,CZCE.TA211 248 | 246,CZCE.LR307 249 | 247,CZCE.UR104 250 | 248,CZCE.PF309 251 | 249,CZCE.CJ205 252 | 250,CZCE.CY208 253 | 251,CZCE.MA107 254 | 252,CZCE.RM303 255 | 253,CZCE.MA010 256 | 254,CZCE.PM101 257 | 255,CZCE.ZC204 258 | 256,CZCE.TA101 259 | 257,CZCE.UR301 260 | 258,CZCE.RI211 261 | 259,CZCE.SA306 262 | 260,CZCE.MA103 263 | 261,CZCE.ZC306 264 | 262,CZCE.SF209 265 | 263,CZCE.AP303 266 | 264,CZCE.RM307 267 | 265,CZCE.JR301 268 | 266,CZCE.SR103 269 | 267,CZCE.OI303 270 | 268,CZCE.OI211 271 | 269,CZCE.UR207 272 | 270,CZCE.SM109 273 | 271,CZCE.SM305 274 | 272,CZCE.SR207 275 | 273,CZCE.WH203 276 | 274,CZCE.AP105 277 | 275,CZCE.RM301 278 | 276,CZCE.MA309 279 | 277,CZCE.CY010 280 | 278,CZCE.LR303 281 | 279,CZCE.OI205 282 | 280,CZCE.SF010 283 | 281,CZCE.MA209 284 | 282,CZCE.ZC305 285 | 283,CZCE.SM203 286 | 284,CZCE.JR101 287 | 285,CZCE.SM105 288 | 286,CZCE.SA103 289 | 287,CZCE.PK112 290 | 288,CZCE.FG303 291 | 289,CZCE.CF101 292 | 290,CZCE.TA208 293 | 291,CZCE.SF211 294 | 292,CZCE.TA103 295 | 293,CZCE.UR202 296 | 294,CZCE.TA309 297 | 295,CZCE.CY206 298 | 296,CZCE.UR012 299 | 297,CZCE.RS207 300 | 298,CZCE.LR101 301 | 299,CZCE.SA106 302 | 300,CZCE.RI103 303 | 301,CZCE.JR307 304 | 302,CZCE.RM308 305 | 303,CZCE.SF110 306 | 304,CZCE.WH209 307 | 305,CZCE.ZC203 308 | 306,CZCE.FG210 309 | 307,CZCE.FG204 310 | 308,CZCE.PM307 311 | 309,CZCE.OI105 312 | 310,CZCE.PK204 313 | 311,CZCE.SA203 314 | 312,CZCE.SF306 315 | 313,CZCE.SM107 316 | 314,CZCE.PM305 317 | 315,CZCE.SA102 318 | 316,CZCE.WH307 319 | 317,CZCE.CF105 320 | 318,CZCE.RS309 321 | 319,CZCE.LR209 322 | 320,CZCE.SA205 323 | 321,CZCE.RM209 324 | 322,CZCE.SF210 325 | 323,CZCE.ZC206 326 | 324,CZCE.PF109 327 | 325,CZCE.CY012 328 | 326,CZCE.MA202 329 | 327,CZCE.SM208 330 | 328,CZCE.FG202 331 | 329,CZCE.PM111 332 | 330,CZCE.UR110 333 | 331,CZCE.TA206 334 | 332,CZCE.FG207 335 | 333,CZCE.UR307 336 | 334,CZCE.SA101 337 | 335,CZCE.ZC110 338 | 336,CZCE.SM211 339 | 337,CZCE.RI309 340 | 338,CZCE.SA210 341 | 339,CZCE.MA105 342 | 340,CZCE.RI205 343 | 341,CZCE.RI207 344 | 342,CZCE.WH111 345 | 343,CZCE.AP101 346 | 344,CZCE.TA210 347 | 345,CZCE.SA303 348 | 346,CZCE.MA205 349 | 347,CZCE.SM108 350 | 348,CZCE.SM012 351 | 349,CZCE.WH205 352 | 350,CZCE.PF207 353 | 351,CZCE.PF305 354 | 352,CZCE.SM110 355 | 353,CZCE.MA112 356 | 354,CZCE.PF210 357 | 355,CZCE.ZC307 358 | 356,CZCE.LR109 359 | 357,CZCE.PM301 360 | 358,CZCE.RI101 361 | 359,CZCE.FG206 362 | 360,CZCE.SR101 363 | 361,CZCE.SM101 364 | 362,CZCE.CY102 365 | 363,CZCE.CY108 366 | 364,CZCE.SM209 367 | 365,CZCE.SF012 368 | 366,CZCE.SF309 369 | 367,CZCE.SA206 370 | 368,CZCE.WH303 371 | 369,CZCE.JR201 372 | 370,CZCE.PM107 373 | 371,CZCE.MA203 374 | 372,CZCE.SR109 375 | 373,CZCE.SA010 376 | 374,CZCE.ZC205 377 | 375,CZCE.TA112 378 | 376,CZCE.CY306 379 | 377,CZCE.SM301 380 | 378,CZCE.CY303 381 | 379,CZCE.SA202 382 | 380,CZCE.FG101 383 | 381,CZCE.PK210 384 | 382,CZCE.JR109 385 | 383,CZCE.RM208 386 | 384,CZCE.SR309 387 | 385,CZCE.SA305 388 | 386,CZCE.RM101 389 | 387,CZCE.CY301 390 | 388,CZCE.TA010 391 | 389,CZCE.TA202 392 | 390,CZCE.PK304 393 | 391,CZCE.AP103 394 | 392,CZCE.CJ307 395 | 393,CZCE.FG208 396 | 394,CZCE.RI011 397 | 395,CZCE.FG112 398 | 396,CZCE.OI111 399 | 397,CZCE.SM103 400 | 398,CZCE.OI203 401 | 399,CZCE.ZC103 402 | 400,CZCE.SA211 403 | 401,CZCE.PF301 404 | 402,CZCE.TA201 405 | 403,CZCE.UR107 406 | 404,CZCE.PM203 407 | 405,CZCE.TA110 408 | 406,CZCE.SR011 409 | 407,CZCE.TA301 410 | 408,CZCE.FG209 411 | 409,CZCE.SA111 412 | 410,CZCE.PM211 413 | 411,CZCE.SF305 414 | 412,CZCE.SF102 415 | 413,CZCE.CY107 416 | 414,CZCE.AP205 417 | 415,CZCE.SF112 418 | 416,CZCE.PK111 419 | 417,CZCE.FG305 420 | 418,CZCE.RI107 421 | 419,CZCE.PM209 422 | 420,CZCE.SA212 423 | 421,CZCE.PM105 424 | 422,CZCE.RM105 425 | 423,CZCE.JR111 426 | 424,CZCE.LR103 427 | 425,CZCE.AP110 428 | 426,CZCE.SF104 429 | 427,CZCE.AP010 430 | 428,CZCE.CJ203 431 | 429,CZCE.SA307 432 | 430,CZCE.SM304 433 | 431,CZCE.PF107 434 | 432,CZCE.WH201 435 | 433,CZCE.MA110 436 | 434,CZCE.SR111 437 | 435,CZCE.UR209 438 | 436,CZCE.PF201 439 | 437,CZCE.MA011 440 | 438,CZCE.PF209 441 | 439,CZCE.CY209 442 | 440,CZCE.ZC011 443 | 441,CZCE.LR301 444 | 442,CZCE.MA102 445 | 443,CZCE.SA301 446 | 444,CZCE.WH207 447 | 445,CZCE.SF307 448 | 446,CZCE.MA210 449 | 447,CZCE.RM309 450 | 448,CZCE.OI301 451 | 449,CZCE.CF209 452 | 450,CZCE.SR205 453 | 451,CZCE.LR207 454 | 452,CZCE.WH309 455 | 453,CZCE.MA301 456 | 454,CZCE.UR304 457 | 455,CZCE.CY101 458 | 456,CZCE.RM107 459 | 457,CZCE.UR201 460 | 458,CZCE.SM204 461 | 459,CZCE.SA308 462 | 460,CZCE.UR108 463 | 461,CZCE.MA212 464 | 462,CZCE.TA207 465 | 463,CZCE.TA102 466 | 464,CZCE.UR102 467 | 465,CZCE.SR307 468 | 466,CZCE.MA106 469 | 467,CZCE.UR205 470 | 468,CZCE.UR308 471 | 469,CZCE.TA106 472 | 470,CZCE.SA112 473 | 471,CZCE.CY011 474 | 472,CZCE.CJ309 475 | 473,CZCE.TA306 476 | 474,CZCE.PK212 477 | 475,CZCE.CY307 478 | 476,CZCE.CY304 479 | 477,CZCE.SF303 480 | 478,CZCE.LR107 481 | 479,CZCE.SR211 482 | 480,CZCE.OI201 483 | 481,CZCE.CJ301 484 | 482,CZCE.ZC102 485 | 483,CZCE.SF302 486 | 484,CZCE.CY104 487 | 485,CZCE.UR111 488 | 486,CZCE.CF111 489 | 487,CZCE.ZC010 490 | 488,CZCE.ZC208 491 | 489,CZCE.CJ109 492 | 490,CZCE.UR305 493 | 491,CZCE.UR105 494 | 492,CZCE.FG309 495 | 493,CZCE.UR204 496 | 494,CZCE.CJ209 497 | 495,CZCE.MA306 498 | 496,CZCE.FG307 499 | 497,CZCE.SR203 500 | 498,CZCE.PF307 501 | 499,CZCE.ZC304 502 | 500,CZCE.SA104 503 | 501,CZCE.TA307 504 | 502,CZCE.TA203 505 | 503,CZCE.SM201 506 | 504,CZCE.RS308 507 | 505,CZCE.RM305 508 | 506,CZCE.FG308 509 | 507,CZCE.PM207 510 | 508,CZCE.AP203 511 | 509,CZCE.SM010 512 | 510,CZCE.SR305 513 | 511,CZCE.SM306 514 | 512,CZCE.TA109 515 | 513,CZCE.ZC303 516 | 514,CZCE.SF207 517 | 515,CZCE.RS307 518 | 516,CZCE.RM103 519 | 517,CZCE.PF303 520 | 518,CZCE.FG105 521 | 519,CZCE.RI201 522 | 520,CZCE.TA108 523 | 521,CZCE.ZC012 524 | 522,CZCE.SM303 525 | 523,CZCE.CF211 526 | 524,CZCE.AP211 527 | 525,CZCE.CY103 528 | 526,CZCE.PF304 529 | 527,CZCE.OI109 530 | 528,CZCE.RI301 531 | 529,CZCE.TA012 532 | 530,CZCE.TA105 533 | 531,CZCE.MA207 534 | 532,CZCE.TA305 535 | 533,CZCE.JR309 536 | 534,CZCE.ZC301 537 | 535,CZCE.SA108 538 | 536,CZCE.PK203 539 | 537,CZCE.MA204 540 | 538,CZCE.CJ012 541 | 539,CZCE.FG110 542 | 540,CZCE.SM309 543 | 541,CZCE.CY203 544 | 542,CZCE.PF204 545 | 543,CZCE.UR011 546 | 544,CZCE.SR201 547 | 545,CZCE.CJ303 548 | 546,CZCE.WH103 549 | 547,CZCE.WH301 550 | 548,CZCE.SF108 551 | 549,CZCE.SF205 552 | 550,CZCE.CY205 553 | 551,CZCE.ZC106 554 | 552,CZCE.CJ101 555 | 553,CZCE.AP011 556 | 554,CZCE.UR101 557 | 555,CZCE.FG111 558 | 556,CZCE.MA012 559 | 557,CZCE.LR111 560 | 558,CZCE.SM102 561 | 559,CZCE.MA302 562 | 560,CZCE.UR212 563 | 561,CZCE.LR205 564 | 562,CZCE.PF110 565 | 563,CZCE.RM211 566 | 564,CZCE.CF011 567 | 565,CZCE.CY309 568 | 566,CZCE.CY308 569 | 567,CZCE.SF212 570 | 568,CZCE.PM109 571 | 569,CZCE.OI101 572 | 570,CZCE.SA309 573 | 571,CZCE.LR105 574 | 572,CZCE.JR011 575 | 573,CZCE.MA109 576 | 574,CZCE.TA302 577 | 575,CZCE.SM106 578 | 576,CZCE.RM108 579 | 577,CZCE.CJ305 580 | 578,CZCE.TA308 581 | 579,CZCE.FG109 582 | 580,CZCE.CJ105 583 | -------------------------------------------------------------------------------- /available_contracts/CZCE_Index.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.i@CZCE.UR 3 | 1,KQ.i@CZCE.JR 4 | 2,KQ.i@CZCE.OI 5 | 3,KQ.i@CZCE.SA 6 | 4,KQ.i@CZCE.CF 7 | 5,KQ.i@CZCE.ZC 8 | 6,KQ.i@CZCE.SM 9 | 7,KQ.i@CZCE.PK 10 | 8,KQ.i@CZCE.WH 11 | 9,KQ.i@CZCE.RS 12 | 10,KQ.i@CZCE.CY 13 | 11,KQ.i@CZCE.TA 14 | 12,KQ.i@CZCE.CJ 15 | 13,KQ.i@CZCE.SR 16 | 14,KQ.i@CZCE.AP 17 | 15,KQ.i@CZCE.PM 18 | 16,KQ.i@CZCE.MA 19 | 17,KQ.i@CZCE.PF 20 | 18,KQ.i@CZCE.SF 21 | 19,KQ.i@CZCE.LR 22 | 20,KQ.i@CZCE.RI 23 | 21,KQ.i@CZCE.RM 24 | 22,KQ.i@CZCE.FG 25 | -------------------------------------------------------------------------------- /available_contracts/CZCE_Main.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,CZCE.CY301 3 | 1,CZCE.CJ301 4 | 2,CZCE.SF211 5 | 3,CZCE.LR301 6 | 4,CZCE.ZC301 7 | 5,CZCE.PK301 8 | 6,CZCE.UR301 9 | 7,CZCE.AP301 10 | 8,CZCE.RS307 11 | 9,CZCE.FG301 12 | 10,CZCE.CF301 13 | 11,CZCE.TA301 14 | 12,CZCE.OI301 15 | 13,CZCE.RM301 16 | 14,CZCE.SM301 17 | 15,CZCE.WH303 18 | 16,CZCE.SA301 19 | 17,CZCE.JR301 20 | 18,CZCE.SR301 21 | 19,CZCE.PF211 22 | 20,CZCE.MA301 23 | 21,CZCE.RI301 24 | 22,CZCE.PM301 25 | -------------------------------------------------------------------------------- /available_contracts/DCE_Cont.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.m@DCE.jm 3 | 1,KQ.m@DCE.c 4 | 2,KQ.m@DCE.pp 5 | 3,KQ.m@DCE.v 6 | 4,KQ.m@DCE.j 7 | 5,KQ.m@DCE.fb 8 | 6,KQ.m@DCE.eg 9 | 7,KQ.m@DCE.rr 10 | 8,KQ.m@DCE.jd 11 | 9,KQ.m@DCE.p 12 | 10,KQ.m@DCE.y 13 | 11,KQ.m@DCE.lh 14 | 12,KQ.m@DCE.bb 15 | 13,KQ.m@DCE.a 16 | 14,KQ.m@DCE.l 17 | 15,KQ.m@DCE.b 18 | 16,KQ.m@DCE.cs 19 | 17,KQ.m@DCE.i 20 | 18,KQ.m@DCE.eb 21 | 19,KQ.m@DCE.pg 22 | 20,KQ.m@DCE.m 23 | -------------------------------------------------------------------------------- /available_contracts/DCE_Index.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.i@DCE.eg 3 | 1,KQ.i@DCE.cs 4 | 2,KQ.i@DCE.jm 5 | 3,KQ.i@DCE.lh 6 | 4,KQ.i@DCE.c 7 | 5,KQ.i@DCE.fb 8 | 6,KQ.i@DCE.y 9 | 7,KQ.i@DCE.bb 10 | 8,KQ.i@DCE.jd 11 | 9,KQ.i@DCE.l 12 | 10,KQ.i@DCE.p 13 | 11,KQ.i@DCE.pp 14 | 12,KQ.i@DCE.j 15 | 13,KQ.i@DCE.pg 16 | 14,KQ.i@DCE.v 17 | 15,KQ.i@DCE.eb 18 | 16,KQ.i@DCE.rr 19 | 17,KQ.i@DCE.i 20 | 18,KQ.i@DCE.a 21 | 19,KQ.i@DCE.m 22 | 20,KQ.i@DCE.b 23 | -------------------------------------------------------------------------------- /available_contracts/DCE_Main.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,DCE.pg2211 3 | 1,DCE.jm2301 4 | 2,DCE.bb2301 5 | 3,DCE.i2301 6 | 4,DCE.eg2301 7 | 5,DCE.rr2212 8 | 6,DCE.a2211 9 | 7,DCE.j2301 10 | 8,DCE.lh2301 11 | 9,DCE.y2301 12 | 10,DCE.eb2211 13 | 11,DCE.b2211 14 | 12,DCE.jd2301 15 | 13,DCE.p2301 16 | 14,DCE.c2301 17 | 15,DCE.v2301 18 | 16,DCE.l2301 19 | 17,DCE.fb2301 20 | 18,DCE.m2301 21 | 19,DCE.pp2301 22 | 20,DCE.cs2211 23 | -------------------------------------------------------------------------------- /available_contracts/INE_Cont.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.m@INE.lu 3 | 1,KQ.m@INE.bc 4 | 2,KQ.m@INE.nr 5 | 3,KQ.m@INE.sc 6 | -------------------------------------------------------------------------------- /available_contracts/INE_Future.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,INE.nr2112 3 | 1,INE.sc2307 4 | 2,INE.nr2303 5 | 3,INE.bc2301 6 | 4,INE.bc2206 7 | 5,INE.sc2203 8 | 6,INE.bc2208 9 | 7,INE.nr2204 10 | 8,INE.bc2103 11 | 9,INE.sc2010 12 | 10,INE.lu2303 13 | 11,INE.bc2105 14 | 12,INE.sc2111 15 | 13,INE.lu2310 16 | 14,INE.nr2202 17 | 15,INE.sc2107 18 | 16,INE.bc2308 19 | 17,INE.lu2308 20 | 18,INE.nr2208 21 | 19,INE.bc2306 22 | 20,INE.bc2202 23 | 21,INE.nr2306 24 | 22,INE.bc2204 25 | 23,INE.nr2308 26 | 24,INE.sc2304 27 | 25,INE.sc2101 28 | 26,INE.lu2109 29 | 27,INE.lu2205 30 | 28,INE.sc2312 31 | 29,INE.lu2309 32 | 30,INE.sc2303 33 | 31,INE.bc2201 34 | 32,INE.lu2102 35 | 33,INE.lu2204 36 | 34,INE.nr2012 37 | 35,INE.nr2205 38 | 36,INE.nr2210 39 | 37,INE.nr2010 40 | 38,INE.bc2106 41 | 39,INE.sc2102 42 | 40,INE.sc2211 43 | 41,INE.nr2110 44 | 42,INE.sc2209 45 | 43,INE.lu2202 46 | 44,INE.bc2210 47 | 45,INE.sc2212 48 | 46,INE.sc2409 49 | 47,INE.sc2306 50 | 48,INE.nr2305 51 | 49,INE.nr2201 52 | 50,INE.bc2305 53 | 51,INE.sc2105 54 | 52,INE.nr2103 55 | 53,INE.bc2211 56 | 54,INE.lu2302 57 | 55,INE.bc2108 58 | 56,INE.nr2102 59 | 57,INE.sc2012 60 | 58,INE.bc2302 61 | 59,INE.sc2208 62 | 60,INE.nr2203 63 | 61,INE.lu2212 64 | 62,INE.nr2304 65 | 63,INE.bc2307 66 | 64,INE.bc2203 67 | 65,INE.lu2110 68 | 66,INE.sc2506 69 | 67,INE.bc2212 70 | 68,INE.sc2104 71 | 69,INE.bc2112 72 | 70,INE.sc2201 73 | 71,INE.lu2211 74 | 72,INE.lu2112 75 | 73,INE.sc2406 76 | 74,INE.sc2503 77 | 75,INE.bc2104 78 | 76,INE.lu2203 79 | 77,INE.nr2109 80 | 78,INE.sc2103 81 | 79,INE.sc2110 82 | 80,INE.nr2302 83 | 81,INE.nr2207 84 | 82,INE.lu2105 85 | 83,INE.sc2202 86 | 84,INE.lu2305 87 | 85,INE.bc2309 88 | 86,INE.sc2403 89 | 87,INE.bc2205 90 | 88,INE.sc2109 91 | 89,INE.bc2107 92 | 90,INE.nr2309 93 | 91,INE.sc2301 94 | 92,INE.nr2107 95 | 93,INE.lu2208 96 | 94,INE.lu2108 97 | 95,INE.sc2210 98 | 96,INE.sc2106 99 | 97,INE.nr2301 100 | 98,INE.nr2105 101 | 99,INE.nr2106 102 | 100,INE.nr2104 103 | 101,INE.lu2201 104 | 102,INE.lu2206 105 | 103,INE.bc2304 106 | 104,INE.nr2307 107 | 105,INE.bc2303 108 | 106,INE.bc2207 109 | 107,INE.nr2211 110 | 108,INE.nr2108 111 | 109,INE.lu2210 112 | 110,INE.sc2308 113 | 111,INE.sc2309 114 | 112,INE.bc2111 115 | 113,INE.nr2209 116 | 114,INE.lu2104 117 | 115,INE.bc2109 118 | 116,INE.lu2306 119 | 117,INE.sc2207 120 | 118,INE.lu2207 121 | 119,INE.sc2206 122 | 120,INE.nr2212 123 | 121,INE.lu2103 124 | 122,INE.lu2304 125 | 123,INE.sc2108 126 | 124,INE.bc2110 127 | 125,INE.nr2111 128 | 126,INE.sc2412 129 | 127,INE.sc2205 130 | 128,INE.bc2209 131 | 129,INE.sc2011 132 | 130,INE.sc2310 133 | 131,INE.lu2106 134 | 132,INE.sc2509 135 | 133,INE.lu2301 136 | 134,INE.lu2307 137 | 135,INE.nr2009 138 | 136,INE.lu2111 139 | 137,INE.lu2209 140 | 138,INE.nr2206 141 | 139,INE.lu2107 142 | 140,INE.sc2112 143 | 141,INE.sc2204 144 | 142,INE.nr2101 145 | 143,INE.sc2305 146 | 144,INE.nr2011 147 | 145,INE.sc2302 148 | 146,INE.lu2101 149 | -------------------------------------------------------------------------------- /available_contracts/INE_Index.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.i@INE.nr 3 | 1,KQ.i@INE.bc 4 | 2,KQ.i@INE.sc 5 | 3,KQ.i@INE.lu 6 | -------------------------------------------------------------------------------- /available_contracts/INE_Main.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,INE.lu2301 3 | 1,INE.nr2212 4 | 2,INE.sc2212 5 | 3,INE.bc2212 6 | -------------------------------------------------------------------------------- /available_contracts/SHFE_Cont.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.m@SHFE.ss 3 | 1,KQ.m@SHFE.bu 4 | 2,KQ.m@SHFE.cu 5 | 3,KQ.m@SHFE.ru 6 | 4,KQ.m@SHFE.rb 7 | 5,KQ.m@SHFE.fu 8 | 6,KQ.m@SHFE.sn 9 | 7,KQ.m@SHFE.zn 10 | 8,KQ.m@SHFE.ni 11 | 9,KQ.m@SHFE.sp 12 | 10,KQ.m@SHFE.hc 13 | 11,KQ.m@SHFE.au 14 | 12,KQ.m@SHFE.pb 15 | 13,KQ.m@SHFE.al 16 | 14,KQ.m@SHFE.ag 17 | 15,KQ.m@SHFE.wr 18 | -------------------------------------------------------------------------------- /available_contracts/SHFE_Future.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,SHFE.au2108 3 | 1,SHFE.zn2106 4 | 2,SHFE.fu2108 5 | 3,SHFE.fu2203 6 | 4,SHFE.ag2206 7 | 5,SHFE.ni2306 8 | 6,SHFE.sn2211 9 | 7,SHFE.au2212 10 | 8,SHFE.cu2303 11 | 9,SHFE.sp2102 12 | 10,SHFE.wr2108 13 | 11,SHFE.sp2101 14 | 12,SHFE.sp2210 15 | 13,SHFE.ni2207 16 | 14,SHFE.rb2209 17 | 15,SHFE.ni2111 18 | 16,SHFE.fu2212 19 | 17,SHFE.pb2301 20 | 18,SHFE.sn2202 21 | 19,SHFE.hc2301 22 | 20,SHFE.rb2205 23 | 21,SHFE.au2106 24 | 22,SHFE.fu2301 25 | 23,SHFE.pb2110 26 | 24,SHFE.sn2210 27 | 25,SHFE.ni2208 28 | 26,SHFE.fu2110 29 | 27,SHFE.zn2107 30 | 28,SHFE.zn2304 31 | 29,SHFE.pb2305 32 | 30,SHFE.cu2302 33 | 31,SHFE.bu2301 34 | 32,SHFE.al2202 35 | 33,SHFE.wr2110 36 | 34,SHFE.ru2110 37 | 35,SHFE.rb2207 38 | 36,SHFE.sp2308 39 | 37,SHFE.bu2309 40 | 38,SHFE.rb2110 41 | 39,SHFE.ru2010 42 | 40,SHFE.fu2105 43 | 41,SHFE.ag2210 44 | 42,SHFE.bu2306 45 | 43,SHFE.zn2208 46 | 44,SHFE.wr2302 47 | 45,SHFE.wr2209 48 | 46,SHFE.zn2306 49 | 47,SHFE.cu2202 50 | 48,SHFE.pb2010 51 | 49,SHFE.sn2209 52 | 50,SHFE.bu2104 53 | 51,SHFE.sn2010 54 | 52,SHFE.pb2303 55 | 53,SHFE.al2105 56 | 54,SHFE.zn2205 57 | 55,SHFE.hc2106 58 | 56,SHFE.cu2212 59 | 57,SHFE.bu2201 60 | 58,SHFE.bu2204 61 | 59,SHFE.ag2103 62 | 60,SHFE.ss2102 63 | 61,SHFE.ss2303 64 | 62,SHFE.ss2105 65 | 63,SHFE.sn2204 66 | 64,SHFE.bu2305 67 | 65,SHFE.bu2010 68 | 66,SHFE.al2201 69 | 67,SHFE.ni2304 70 | 68,SHFE.pb2104 71 | 69,SHFE.ni2211 72 | 70,SHFE.ni2011 73 | 71,SHFE.rb2301 74 | 72,SHFE.ru2304 75 | 73,SHFE.bu2207 76 | 74,SHFE.sn2307 77 | 75,SHFE.hc2211 78 | 76,SHFE.zn2206 79 | 77,SHFE.zn2112 80 | 78,SHFE.cu2010 81 | 79,SHFE.al2206 82 | 80,SHFE.sp2305 83 | 81,SHFE.ru2206 84 | 82,SHFE.bu2203 85 | 83,SHFE.hc2208 86 | 84,SHFE.bu2206 87 | 85,SHFE.ss2208 88 | 86,SHFE.al2103 89 | 87,SHFE.fu2204 90 | 88,SHFE.sp2109 91 | 89,SHFE.ag2205 92 | 90,SHFE.pb2011 93 | 91,SHFE.bu2312 94 | 92,SHFE.hc2010 95 | 93,SHFE.sn2304 96 | 94,SHFE.ss2108 97 | 95,SHFE.ni2102 98 | 96,SHFE.pb2105 99 | 97,SHFE.ru2203 100 | 98,SHFE.fu2307 101 | 99,SHFE.wr2102 102 | 100,SHFE.cu2201 103 | 101,SHFE.sp2202 104 | 102,SHFE.sn2110 105 | 103,SHFE.fu2010 106 | 104,SHFE.zn2309 107 | 105,SHFE.ru2109 108 | 106,SHFE.zn2105 109 | 107,SHFE.fu2210 110 | 108,SHFE.zn2012 111 | 109,SHFE.pb2203 112 | 110,SHFE.cu2308 113 | 111,SHFE.bu2105 114 | 112,SHFE.ru2306 115 | 113,SHFE.ss2203 116 | 114,SHFE.ag2201 117 | 115,SHFE.al2212 118 | 116,SHFE.ru2011 119 | 117,SHFE.zn2302 120 | 118,SHFE.hc2305 121 | 119,SHFE.ni2209 122 | 120,SHFE.wr2306 123 | 121,SHFE.wr2309 124 | 122,SHFE.ru2305 125 | 123,SHFE.sn2212 126 | 124,SHFE.cu2109 127 | 125,SHFE.al2110 128 | 126,SHFE.wr2211 129 | 127,SHFE.cu2305 130 | 128,SHFE.pb2201 131 | 129,SHFE.al2309 132 | 130,SHFE.bu2406 133 | 131,SHFE.al2210 134 | 132,SHFE.sp2303 135 | 133,SHFE.ni2010 136 | 134,SHFE.ni2201 137 | 135,SHFE.pb2309 138 | 136,SHFE.ss2209 139 | 137,SHFE.bu2111 140 | 138,SHFE.bu2107 141 | 139,SHFE.hc2204 142 | 140,SHFE.ni2202 143 | 141,SHFE.ru2105 144 | 142,SHFE.ru2309 145 | 143,SHFE.wr2105 146 | 144,SHFE.ag2306 147 | 145,SHFE.cu2009 148 | 146,SHFE.hc2309 149 | 147,SHFE.pb2009 150 | 148,SHFE.ag2108 151 | 149,SHFE.ag2204 152 | 150,SHFE.sp2206 153 | 151,SHFE.zn2103 154 | 152,SHFE.wr2104 155 | 153,SHFE.pb2204 156 | 154,SHFE.au2201 157 | 155,SHFE.ss2302 158 | 156,SHFE.ss2104 159 | 157,SHFE.al2203 160 | 158,SHFE.zn2303 161 | 159,SHFE.sp2112 162 | 160,SHFE.ni2109 163 | 161,SHFE.sn2205 164 | 162,SHFE.bu2106 165 | 163,SHFE.pb2109 166 | 164,SHFE.al2307 167 | 165,SHFE.sn2106 168 | 166,SHFE.sp2108 169 | 167,SHFE.fu2306 170 | 168,SHFE.ni2108 171 | 169,SHFE.hc2108 172 | 170,SHFE.ru2303 173 | 171,SHFE.fu2109 174 | 172,SHFE.wr2307 175 | 173,SHFE.ss2206 176 | 174,SHFE.fu2012 177 | 175,SHFE.rb2112 178 | 176,SHFE.hc2207 179 | 177,SHFE.fu2104 180 | 178,SHFE.zn2011 181 | 179,SHFE.sp2306 182 | 180,SHFE.fu2211 183 | 181,SHFE.ni2107 184 | 182,SHFE.sp2212 185 | 183,SHFE.sp2307 186 | 184,SHFE.al2304 187 | 185,SHFE.hc2102 188 | 186,SHFE.fu2011 189 | 187,SHFE.fu2206 190 | 188,SHFE.pb2304 191 | 189,SHFE.ni2106 192 | 190,SHFE.sn2103 193 | 191,SHFE.cu2108 194 | 192,SHFE.ag2010 195 | 193,SHFE.pb2107 196 | 194,SHFE.rb2105 197 | 195,SHFE.pb2111 198 | 196,SHFE.au2304 199 | 197,SHFE.zn2101 200 | 198,SHFE.cu2105 201 | 199,SHFE.sn2207 202 | 200,SHFE.rb2109 203 | 201,SHFE.au2306 204 | 202,SHFE.al2109 205 | 203,SHFE.sn2109 206 | 204,SHFE.hc2011 207 | 205,SHFE.zn2201 208 | 206,SHFE.pb2306 209 | 207,SHFE.al2308 210 | 208,SHFE.au2112 211 | 209,SHFE.rb2212 212 | 210,SHFE.wr2204 213 | 211,SHFE.au2111 214 | 212,SHFE.ni2303 215 | 213,SHFE.zn2104 216 | 214,SHFE.sp2201 217 | 215,SHFE.au2302 218 | 216,SHFE.pb2308 219 | 217,SHFE.au2308 220 | 218,SHFE.hc2012 221 | 219,SHFE.fu2207 222 | 220,SHFE.ss2210 223 | 221,SHFE.pb2209 224 | 222,SHFE.au2207 225 | 223,SHFE.sp2012 226 | 224,SHFE.cu2206 227 | 225,SHFE.cu2309 228 | 226,SHFE.zn2307 229 | 227,SHFE.pb2208 230 | 228,SHFE.ru2307 231 | 229,SHFE.fu2308 232 | 230,SHFE.au2109 233 | 231,SHFE.ni2206 234 | 232,SHFE.al2207 235 | 233,SHFE.rb2104 236 | 234,SHFE.sp2105 237 | 235,SHFE.ss2211 238 | 236,SHFE.wr2202 239 | 237,SHFE.rb2302 240 | 238,SHFE.pb2210 241 | 239,SHFE.zn2301 242 | 240,SHFE.ag2308 243 | 241,SHFE.hc2307 244 | 242,SHFE.sn2108 245 | 243,SHFE.au2209 246 | 244,SHFE.hc2103 247 | 245,SHFE.cu2011 248 | 246,SHFE.hc2112 249 | 247,SHFE.bu2205 250 | 248,SHFE.au2105 251 | 249,SHFE.ag2012 252 | 250,SHFE.ru2207 253 | 251,SHFE.hc2105 254 | 252,SHFE.bu2102 255 | 253,SHFE.sn2102 256 | 254,SHFE.ag2109 257 | 255,SHFE.cu2204 258 | 256,SHFE.ag2304 259 | 257,SHFE.al2009 260 | 258,SHFE.cu2103 261 | 259,SHFE.zn2109 262 | 260,SHFE.hc2203 263 | 261,SHFE.rb2202 264 | 262,SHFE.ss2103 265 | 263,SHFE.bu2403 266 | 264,SHFE.rb2107 267 | 265,SHFE.sp2111 268 | 266,SHFE.ag2305 269 | 267,SHFE.bu2308 270 | 268,SHFE.au2010 271 | 269,SHFE.al2208 272 | 270,SHFE.pb2202 273 | 271,SHFE.zn2204 274 | 272,SHFE.rb2010 275 | 273,SHFE.zn2009 276 | 274,SHFE.ag2011 277 | 275,SHFE.ag2207 278 | 276,SHFE.wr2106 279 | 277,SHFE.cu2306 280 | 278,SHFE.wr2112 281 | 279,SHFE.hc2109 282 | 280,SHFE.au2208 283 | 281,SHFE.ag2102 284 | 282,SHFE.ru2103 285 | 283,SHFE.fu2305 286 | 284,SHFE.sp2208 287 | 285,SHFE.cu2104 288 | 286,SHFE.pb2106 289 | 287,SHFE.zn2102 290 | 288,SHFE.zn2212 291 | 289,SHFE.ru2208 292 | 290,SHFE.cu2208 293 | 291,SHFE.rb2208 294 | 292,SHFE.hc2210 295 | 293,SHFE.ss2309 296 | 294,SHFE.fu2310 297 | 295,SHFE.rb2101 298 | 296,SHFE.au2104 299 | 297,SHFE.hc2308 300 | 298,SHFE.cu2304 301 | 299,SHFE.ru2205 302 | 300,SHFE.cu2211 303 | 301,SHFE.ag2208 304 | 302,SHFE.wr2111 305 | 303,SHFE.sn2201 306 | 304,SHFE.wr2107 307 | 305,SHFE.hc2212 308 | 306,SHFE.ni2009 309 | 307,SHFE.sn2303 310 | 308,SHFE.cu2012 311 | 309,SHFE.cu2307 312 | 310,SHFE.cu2110 313 | 311,SHFE.ni2112 314 | 312,SHFE.sn2206 315 | 313,SHFE.fu2303 316 | 314,SHFE.wr2012 317 | 315,SHFE.ru2209 318 | 316,SHFE.pb2206 319 | 317,SHFE.pb2302 320 | 318,SHFE.hc2209 321 | 319,SHFE.bu2208 322 | 320,SHFE.wr2201 323 | 321,SHFE.bu2108 324 | 322,SHFE.sp2009 325 | 323,SHFE.rb2009 326 | 324,SHFE.ru2111 327 | 325,SHFE.hc2104 328 | 326,SHFE.rb2307 329 | 327,SHFE.wr2301 330 | 328,SHFE.cu2301 331 | 329,SHFE.fu2101 332 | 330,SHFE.ag2101 333 | 331,SHFE.fu2302 334 | 332,SHFE.bu2304 335 | 333,SHFE.ni2012 336 | 334,SHFE.sn2309 337 | 335,SHFE.sn2203 338 | 336,SHFE.ss2009 339 | 337,SHFE.pb2112 340 | 338,SHFE.al2211 341 | 339,SHFE.sn2101 342 | 340,SHFE.ag2111 343 | 341,SHFE.au2009 344 | 342,SHFE.au2012 345 | 343,SHFE.cu2205 346 | 344,SHFE.sp2204 347 | 345,SHFE.sp2301 348 | 346,SHFE.sp2010 349 | 347,SHFE.al2108 350 | 348,SHFE.bu2202 351 | 349,SHFE.hc2201 352 | 350,SHFE.ru2106 353 | 351,SHFE.pb2012 354 | 352,SHFE.ru2201 355 | 353,SHFE.au2205 356 | 354,SHFE.fu2103 357 | 355,SHFE.cu2102 358 | 356,SHFE.wr2303 359 | 357,SHFE.sp2110 360 | 358,SHFE.sp2203 361 | 359,SHFE.fu2111 362 | 360,SHFE.zn2202 363 | 361,SHFE.ru2101 364 | 362,SHFE.rb2303 365 | 363,SHFE.wr2109 366 | 364,SHFE.pb2108 367 | 365,SHFE.au2203 368 | 366,SHFE.wr2208 369 | 367,SHFE.fu2208 370 | 368,SHFE.ni2309 371 | 369,SHFE.sp2107 372 | 370,SHFE.pb2102 373 | 371,SHFE.ru2308 374 | 372,SHFE.sp2205 375 | 373,SHFE.bu2011 376 | 374,SHFE.cu2203 377 | 375,SHFE.ni2308 378 | 376,SHFE.cu2112 379 | 377,SHFE.ag2104 380 | 378,SHFE.wr2009 381 | 379,SHFE.ag2301 382 | 380,SHFE.sn2301 383 | 381,SHFE.ss2204 384 | 382,SHFE.sn2302 385 | 383,SHFE.ag2203 386 | 384,SHFE.ag2212 387 | 385,SHFE.al2305 388 | 386,SHFE.ag2106 389 | 387,SHFE.hc2110 390 | 388,SHFE.sp2207 391 | 389,SHFE.pb2211 392 | 390,SHFE.ag2107 393 | 391,SHFE.rb2201 394 | 392,SHFE.ss2111 395 | 393,SHFE.sn2107 396 | 394,SHFE.fu2112 397 | 395,SHFE.bu2307 398 | 396,SHFE.ru2104 399 | 397,SHFE.ag2202 400 | 398,SHFE.sp2106 401 | 399,SHFE.hc2302 402 | 400,SHFE.ss2101 403 | 401,SHFE.ag2211 404 | 402,SHFE.ss2205 405 | 403,SHFE.sn2009 406 | 404,SHFE.hc2306 407 | 405,SHFE.ni2203 408 | 406,SHFE.ni2204 409 | 407,SHFE.ru2107 410 | 408,SHFE.al2306 411 | 409,SHFE.hc2107 412 | 410,SHFE.ss2107 413 | 411,SHFE.sp2302 414 | 412,SHFE.pb2307 415 | 413,SHFE.au2103 416 | 414,SHFE.ni2302 417 | 415,SHFE.ni2305 418 | 416,SHFE.ss2109 419 | 417,SHFE.au2101 420 | 418,SHFE.sn2305 421 | 419,SHFE.rb2102 422 | 420,SHFE.rb2106 423 | 421,SHFE.ag2307 424 | 422,SHFE.cu2106 425 | 423,SHFE.ru2108 426 | 424,SHFE.rb2309 427 | 425,SHFE.bu2303 428 | 426,SHFE.al2104 429 | 427,SHFE.sn2308 430 | 428,SHFE.hc2111 431 | 429,SHFE.al2010 432 | 430,SHFE.ni2104 433 | 431,SHFE.fu2201 434 | 432,SHFE.rb2306 435 | 433,SHFE.rb2305 436 | 434,SHFE.ss2207 437 | 435,SHFE.zn2305 438 | 436,SHFE.au2206 439 | 437,SHFE.sp2309 440 | 438,SHFE.rb2204 441 | 439,SHFE.ag2209 442 | 440,SHFE.au2210 443 | 441,SHFE.ag2302 444 | 442,SHFE.au2102 445 | 443,SHFE.hc2009 446 | 444,SHFE.bu2103 447 | 445,SHFE.al2011 448 | 446,SHFE.al2101 449 | 447,SHFE.sn2111 450 | 448,SHFE.ru2204 451 | 449,SHFE.ss2307 452 | 450,SHFE.hc2206 453 | 451,SHFE.ru2211 454 | 452,SHFE.wr2305 455 | 453,SHFE.zn2010 456 | 454,SHFE.ag2009 457 | 455,SHFE.ru2009 458 | 456,SHFE.cu2207 459 | 457,SHFE.rb2308 460 | 458,SHFE.wr2212 461 | 459,SHFE.bu2109 462 | 460,SHFE.cu2111 463 | 461,SHFE.ru2301 464 | 462,SHFE.ss2110 465 | 463,SHFE.ag2110 466 | 464,SHFE.bu2112 467 | 465,SHFE.bu2211 468 | 466,SHFE.rb2011 469 | 467,SHFE.sn2306 470 | 468,SHFE.pb2207 471 | 469,SHFE.fu2209 472 | 470,SHFE.ag2112 473 | 471,SHFE.pb2212 474 | 472,SHFE.zn2210 475 | 473,SHFE.fu2304 476 | 474,SHFE.wr2206 477 | 475,SHFE.pb2101 478 | 476,SHFE.ni2101 479 | 477,SHFE.ag2303 480 | 478,SHFE.zn2308 481 | 479,SHFE.rb2012 482 | 480,SHFE.ni2103 483 | 481,SHFE.pb2205 484 | 482,SHFE.hc2202 485 | 483,SHFE.zn2111 486 | 484,SHFE.al2301 487 | 485,SHFE.rb2111 488 | 486,SHFE.al2204 489 | 487,SHFE.au2202 490 | 488,SHFE.ni2110 491 | 489,SHFE.au2110 492 | 490,SHFE.ru2210 493 | 491,SHFE.pb2103 494 | 492,SHFE.bu2110 495 | 493,SHFE.sp2304 496 | 494,SHFE.zn2211 497 | 495,SHFE.bu2409 498 | 496,SHFE.sn2012 499 | 497,SHFE.ss2301 500 | 498,SHFE.wr2308 501 | 499,SHFE.wr2203 502 | 500,SHFE.au2310 503 | 501,SHFE.wr2205 504 | 502,SHFE.sp2104 505 | 503,SHFE.fu2107 506 | 504,SHFE.cu2209 507 | 505,SHFE.fu2202 508 | 506,SHFE.rb2108 509 | 507,SHFE.al2209 510 | 508,SHFE.al2012 511 | 509,SHFE.zn2108 512 | 510,SHFE.ss2201 513 | 511,SHFE.ss2011 514 | 512,SHFE.sn2208 515 | 513,SHFE.zn2203 516 | 514,SHFE.ss2106 517 | 515,SHFE.cu2210 518 | 516,SHFE.al2107 519 | 517,SHFE.rb2103 520 | 518,SHFE.al2302 521 | 519,SHFE.ss2304 522 | 520,SHFE.bu2009 523 | 521,SHFE.fu2102 524 | 522,SHFE.sn2105 525 | 523,SHFE.cu2101 526 | 524,SHFE.au2211 527 | 525,SHFE.ss2308 528 | 526,SHFE.rb2211 529 | 527,SHFE.au2204 530 | 528,SHFE.sn2104 531 | 529,SHFE.ni2212 532 | 530,SHFE.ag2309 533 | 531,SHFE.sn2112 534 | 532,SHFE.rb2304 535 | 533,SHFE.ni2301 536 | 534,SHFE.zn2207 537 | 535,SHFE.sp2103 538 | 536,SHFE.hc2205 539 | 537,SHFE.ss2212 540 | 538,SHFE.rb2203 541 | 539,SHFE.sp2011 542 | 540,SHFE.al2303 543 | 541,SHFE.bu2012 544 | 542,SHFE.bu2210 545 | 543,SHFE.al2102 546 | 544,SHFE.bu2302 547 | 545,SHFE.wr2103 548 | 546,SHFE.wr2011 549 | 547,SHFE.fu2106 550 | 548,SHFE.au2011 551 | 549,SHFE.ni2105 552 | 550,SHFE.zn2209 553 | 551,SHFE.ss2305 554 | 552,SHFE.sn2011 555 | 553,SHFE.ss2012 556 | 554,SHFE.hc2304 557 | 555,SHFE.fu2205 558 | 556,SHFE.ss2202 559 | 557,SHFE.cu2107 560 | 558,SHFE.ni2205 561 | 559,SHFE.bu2212 562 | 560,SHFE.bu2209 563 | 561,SHFE.ss2112 564 | 562,SHFE.wr2101 565 | 563,SHFE.ni2210 566 | 564,SHFE.wr2010 567 | 565,SHFE.hc2101 568 | 566,SHFE.hc2303 569 | 567,SHFE.al2205 570 | 568,SHFE.ag2105 571 | 569,SHFE.zn2110 572 | 570,SHFE.ss2010 573 | 571,SHFE.rb2206 574 | 572,SHFE.au2107 575 | 573,SHFE.wr2210 576 | 574,SHFE.wr2304 577 | 575,SHFE.sp2209 578 | 576,SHFE.al2112 579 | 577,SHFE.sp2211 580 | 578,SHFE.fu2309 581 | 579,SHFE.al2106 582 | 580,SHFE.ss2306 583 | 581,SHFE.al2111 584 | 582,SHFE.bu2101 585 | 583,SHFE.wr2207 586 | 584,SHFE.rb2210 587 | 585,SHFE.ni2307 588 | -------------------------------------------------------------------------------- /available_contracts/SHFE_Index.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,KQ.i@SHFE.sp 3 | 1,KQ.i@SHFE.zn 4 | 2,KQ.i@SHFE.ni 5 | 3,KQ.i@SHFE.fu 6 | 4,KQ.i@SHFE.hc 7 | 5,KQ.i@SHFE.pb 8 | 6,KQ.i@SHFE.au 9 | 7,KQ.i@SHFE.ru 10 | 8,KQ.i@SHFE.al 11 | 9,KQ.i@SHFE.cu 12 | 10,KQ.i@SHFE.sn 13 | 11,KQ.i@SHFE.bu 14 | 12,KQ.i@SHFE.ss 15 | 13,KQ.i@SHFE.ag 16 | 14,KQ.i@SHFE.wr 17 | 15,KQ.i@SHFE.rb 18 | -------------------------------------------------------------------------------- /available_contracts/SHFE_Main.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,SHFE.fu2301 3 | 1,SHFE.au2212 4 | 2,SHFE.sp2301 5 | 3,SHFE.rb2301 6 | 4,SHFE.ag2212 7 | 5,SHFE.ni2211 8 | 6,SHFE.sn2211 9 | 7,SHFE.zn2211 10 | 8,SHFE.ss2211 11 | 9,SHFE.al2211 12 | 10,SHFE.ru2301 13 | 11,SHFE.pb2211 14 | 12,SHFE.hc2301 15 | 13,SHFE.bu2212 16 | 14,SHFE.cu2211 17 | 15,SHFE.wr2301 18 | -------------------------------------------------------------------------------- /dtview.py: -------------------------------------------------------------------------------- 1 | from functools import partial 2 | from random import randrange 3 | 4 | from PySide6.QtCore import QPoint, Qt, QTimer 5 | from PySide6.QtGui import QPainter, QColor 6 | from PySide6.QtCharts import * 7 | from PySide6.QtWidgets import QGridLayout 8 | 9 | 10 | class ChartWidget: 11 | def __init__(self, widget): 12 | super().__init__() 13 | self.widget = widget 14 | self.chart = QChart() 15 | self._chart_view = QChartView(self.chart) 16 | self.chart.ChartTheme(QChart.ChartThemeDark) 17 | self._axis_y = QValueAxis() 18 | self._axis_x = QBarCategoryAxis() 19 | self.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] 20 | self._line_series = QLineSeries() 21 | self._bar_series = QBarSeries() 22 | self.set4 = QBarSet("Smartphones") 23 | self.set3 = QBarSet("iPhones") 24 | self.set2 = QBarSet("AirPods") 25 | self.set1 = QBarSet("Tablets") 26 | self.set0 = QBarSet("iMac") 27 | 28 | def add_chart(self): 29 | self.set0.append([1, 2, 3, 4, 5, 6]) 30 | self.set1.append([5, 0, 0, 4, 0, 7]) 31 | self.set2.append([3, 5, 8, 13, 8, 5]) 32 | self.set3.append([5, 6, 7, 3, 4, 5]) 33 | self.set4.append([9, 7, 5, 3, 1, 2]) 34 | 35 | self._bar_series.append(self.set0) 36 | self._bar_series.append(self.set1) 37 | self._bar_series.append(self.set2) 38 | self._bar_series.append(self.set3) 39 | self._bar_series.append(self.set4) 40 | 41 | self._line_series.setName("Treds") 42 | self._line_series.append(QPoint(0, 4)) 43 | self._line_series.append(QPoint(1, 15)) 44 | self._line_series.append(QPoint(2, 20)) 45 | self._line_series.append(QPoint(3, 4)) 46 | self._line_series.append(QPoint(4, 12)) 47 | self._line_series.append(QPoint(5, 17)) 48 | 49 | self.chart.addSeries(self._bar_series) 50 | self.chart.addSeries(self._line_series) 51 | self.chart.setTitle("Line and barchart example") 52 | 53 | self._axis_x.append(self.categories) 54 | self.chart.setAxisX(self._axis_x, self._line_series) 55 | self.chart.setAxisX(self._axis_x, self._bar_series) 56 | self._axis_x.setRange("Jan", "Jun") 57 | 58 | self.chart.setAxisY(self._axis_y, self._line_series) 59 | self.chart.setAxisY(self._axis_y, self._bar_series) 60 | self._axis_y.setRange(0, 20) 61 | 62 | self.chart.legend().setVisible(True) 63 | self.chart.legend().setAlignment(Qt.AlignBottom) 64 | 65 | self._chart_view.setRenderHint(QPainter.Antialiasing) 66 | 67 | self.widget.addWidget(self._chart_view) 68 | 69 | 70 | class DonutWidget: 71 | def __init__(self, pie): 72 | self.pie = pie # 初始化饼图 73 | self.donuts = [] # 初始化饼图列表 74 | self.chart_view = QChartView() # 初始化图表视图 75 | self.chart_view.setRenderHint(QPainter.Antialiasing) # 设置抗锯齿 76 | self.chart = self.chart_view.chart() # 获取图表 77 | self.chart.legend().setVisible(False) # 隐藏图例 78 | # self.chart.setTitle("用户统计") # 设置图表标题 79 | self.chart.setTheme(QChart.ChartThemeDark) # 设置图表主题 80 | # 设置图表的背景颜色 81 | self.chart.setBackgroundBrush(QColor(0, 0, 0, 0)) # 设置图表的背景颜色 82 | self.chart.setAnimationOptions(QChart.AllAnimations) # 设置动画效果 83 | 84 | self.min_size = 0.1 # 最小占比 85 | self.max_size = 1 # 最大占比 86 | self.donut_count = 5 # donut 圈数 87 | 88 | self.add_donut() # 添加饼图 89 | 90 | # create main layout # 创建主布局 91 | self.main_layout = self.pie # 主布局为饼图 92 | self.main_layout.addWidget(self.chart_view, 1) # 添加图表视图 93 | # self.setLayout(self.main_layout) # 设置主布局 94 | 95 | self.update_timer = QTimer() # 初始化定时器 96 | self.update_timer.timeout.connect(self.update_rotation) # 设置定时器超时信号 97 | self.update_timer.start(1000) # 启动定时器 98 | 99 | def add_donut(self): 100 | for i in range(self.donut_count): # 循环添加饼图 101 | donut = QPieSeries() # 创建一个饼图 102 | slccount = randrange(3, 6) # slice 圈数 103 | for j in range(slccount): 104 | value = randrange(100, 200) # slice 值 105 | 106 | slc = QPieSlice(str(value), value) # 创建一个 slice 107 | slc.setLabelVisible(True) # 显示 slice 标签 108 | slc.setLabelColor(Qt.white) # slice 标签颜色 109 | slc.setLabelPosition(QPieSlice.LabelInsideTangential) # slice 标签位置 110 | 111 | # Connection using an extra parameter for the slot 112 | slc.hovered[bool].connect(partial(self.explode_slice, slc=slc)) # slice 鼠标悬浮事件 113 | 114 | donut.append(slc) # 添加 slice 到饼图 115 | size = (self.max_size - self.min_size) / self.donut_count # slice 大小 116 | donut.setHoleSize(self.min_size + i * size) # 设置饼图的孔大小 117 | donut.setPieSize(self.min_size + (i + 1) * size) # 设置饼图的大小 118 | 119 | self.donuts.append(donut) # 添加饼图到列表 120 | self.chart_view.chart().addSeries(donut) # 添加饼图到图表 121 | 122 | def update_rotation(self): # 更新饼图旋转角度 123 | for donut in self.donuts: # 遍历所有饼图 124 | phase_shift = randrange(-50, 100) # 饼图旋转角度 125 | donut.setPieStartAngle(donut.pieStartAngle() + phase_shift) # 更新饼图旋转角度 126 | donut.setPieEndAngle(donut.pieEndAngle() + phase_shift) # 更新饼图旋转角度 127 | 128 | def explode_slice(self, exploded, slc): # slice 是否被挤压 129 | if exploded: # slice 被挤压 130 | self.update_timer.stop() # 停止更新饼图旋转角度 131 | slice_startangle = slc.startAngle() # slice 开始角度 132 | slice_endangle = slc.startAngle() + slc.angleSpan() # slice 结束角度 133 | 134 | donut = slc.series() # 获取 slice 对应的饼图 135 | idx = self.donuts.index(donut) # 获取饼图在列表中的索引 136 | for i in range(idx + 1, len(self.donuts)): # 遍历所有饼图 137 | self.donuts[i].setPieStartAngle(slice_endangle) # 更新饼图开始角度 138 | self.donuts[i].setPieEndAngle(360 + slice_startangle) # 更新饼图结束角度 139 | else: 140 | for donut in self.donuts: # 遍历所有饼图 141 | donut.setPieStartAngle(0) # 更新饼图开始角度 142 | donut.setPieEndAngle(360) # 更新饼图结束角度 143 | 144 | self.update_timer.start() 145 | 146 | slc.setExploded(exploded) # 更新 slice 是否被挤压 147 | -------------------------------------------------------------------------------- /icons/1246348342.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/icons/1246348342.png -------------------------------------------------------------------------------- /icons/453453542155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/icons/453453542155.png -------------------------------------------------------------------------------- /icons/Excel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/arrow-down-bold.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/arrow-right-bold.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/chrome.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/上.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/下.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/作者.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /icons/关闭 (1).svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/关闭.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/减号.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/分类.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/双下拉箭头.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/折叠-展开.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/更多.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/最大化-还原.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/最小化.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 54 | 55 | 56 | background 57 | 58 | 59 | 60 | Layer 1 61 | 62 | 63 | -------------------------------------------------------------------------------- /icons/清屏.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/箭头_向右.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/箭头_向左.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/缩小.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/菜单.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/警告.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /icons/设置.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /logo/Default_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/logo/Default_photo.png -------------------------------------------------------------------------------- /logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/logo/logo.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | THEME = "dark" # 皮肤选择 这里的THEME改为 dark 为深色模式,改为 light 为浅色模式 4 | 5 | from MainWindows_Inheritance import * 6 | 7 | if __name__ == "__main__": 8 | app = QApplication(sys.argv) 9 | window = Main_window() 10 | window.show() 11 | sys.exit(app.exec()) 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /parameter.py: -------------------------------------------------------------------------------- 1 | # # coding:utf-8 2 | import json 3 | import os 4 | import pandas as pd 5 | 6 | 7 | def add_param(my_df, path): 8 | data = read_excel_file(path) 9 | data = data.append(my_df,ignore_index=True) 10 | 11 | write_config_file(data, path) 12 | print('数据已存入config文件') 13 | 14 | def read_excel_file(path): 15 | df = pd.read_excel(path,index_col=0) 16 | return df 17 | 18 | def write_config_file(df_tmp, path, encoding='utf-8',index=False): 19 | df = pd.DataFrame(df_tmp) 20 | df.to_excel(path) 21 | 22 | def judge_config_exist(path): 23 | dirs = './data/' 24 | if not os.path.exists(dirs): 25 | os.makedirs(dirs) 26 | if not os.path.exists(path): 27 | df_tmp = pd.DataFrame() 28 | write_config_file(df_tmp, path) -------------------------------------------------------------------------------- /read_write_file.py: -------------------------------------------------------------------------------- 1 | # # coding:utf-8 2 | 3 | import sys 4 | import os 5 | import time 6 | import datetime 7 | 8 | import pandas as pd 9 | 10 | 11 | class ReadWriteCsv(object): # csv文件读写类 12 | 13 | def add_dict_to_csv(self, my_df, path): 14 | data = self.read_csv_file(path) 15 | data = pd.concat([data, my_df], ignore_index=True) 16 | 17 | self.write_datas_to_csv_file(data, path) 18 | print('数据已存入config文件') 19 | 20 | 21 | def read_csv_file(self, path, converters=None): # 加了converters,读取时强制按指定类型读取 22 | 23 | df = pd.read_csv(path, engine='python', index_col=0, converters=converters) 24 | return df 25 | 26 | 27 | def write_datas_to_csv_file(self, df_tmp, path, encoding='utf_8_sig'): 28 | df = pd.DataFrame(df_tmp) 29 | df.to_csv(path, encoding=encoding) 30 | 31 | 32 | def judge_dirs_exist(self, dirs): # 判断目录是否存在 33 | 34 | if not os.path.exists(dirs): 35 | os.makedirs(dirs) 36 | print('文件目录' + dirs + '不存在,已创建') 37 | else: 38 | pass 39 | 40 | 41 | def judge_file_exist(self, path): # 判断文件是否存在 42 | 43 | if not os.path.exists(path): 44 | df_tmp = pd.DataFrame() 45 | self.write_datas_to_csv_file(df_tmp, path) 46 | print('文件' + path + '不存在,已创建空白文件') 47 | else: 48 | pass 49 | 50 | def delete_file(self, path): 51 | os.remove(path) 52 | 53 | class ReadWriteExcel(object): # excel文件读写类 54 | 55 | def add_dict_to_excel(self, my_df, path): 56 | data = self.read_excel_file(path) 57 | data = pd.concat([data, my_df], ignore_index=True) 58 | 59 | self.write_config_file(data, path) 60 | print('数据已存入config文件') 61 | 62 | def read_excel_file(self, path): 63 | df = pd.read_excel(path,index_col=0) 64 | return df 65 | 66 | def write_config_file(self, df_tmp, path, encoding='utf-8',index=False): 67 | df = pd.DataFrame(df_tmp) 68 | df.to_excel(path) 69 | 70 | def judge_config_exist(self, path): 71 | dirs = './data/' 72 | if not os.path.exists(dirs): 73 | os.makedirs(dirs) 74 | print('文件目录' + dirs + '不存在,已创建') 75 | else: 76 | pass 77 | 78 | if not os.path.exists(path): 79 | df_tmp = pd.DataFrame() 80 | self.write_config_file(df_tmp, path) 81 | print('文件' + path + '不存在,已创建空白文件') 82 | else: 83 | print('文件' + path + '存在') 84 | 85 | 86 | class Logger(object): # 日志记录类 87 | def __init__(self, process_name): 88 | 89 | self.path = "./log/" + process_name + '/' # 在log目录下创建以 process_name 命名的文件夹 90 | self.log_filename = datetime.datetime.now().strftime('%Y_%m_%d') + '.log' # 日志文件名,以当前日期为名 91 | self.terminal = sys.stdout 92 | 93 | # 检查self.path是否存在,不存在则创建 94 | if not os.path.exists(self.path): 95 | os.makedirs(self.path) 96 | # 检查self.path下是否存在self.log_filename文件,不存在则创建空白文件 97 | if not os.path.exists(self.path + self.log_filename): 98 | with open(self.path + self.log_filename, 'w') as f: 99 | f.write('') 100 | 101 | print('空白日志文件已创建,路径为:' + self.path + self.log_filename) 102 | 103 | # 打开self.path下的self.log_filename文件,并写入日志 104 | self.log = open(os.path.join(self.path, self.log_filename), "a", buffering = 1, encoding='utf8',) 105 | 106 | 107 | # open(file, ‘w’, buffering = a) 中,buffering设置缓冲行为 108 | # 全缓冲: a 是正整数,当缓冲区文件大小达到a大小时候,写入磁盘 109 | # 行缓冲: buffering = 1, 缓冲区碰到 \n 换行符的时候就写入磁盘 110 | # 无缓冲:buffering = 0 ,写多少,存多少 111 | 112 | 113 | print('*' * 40,' ', self.log_filename, ' ', '*' * 40) 114 | print('\n') 115 | print('开始记录 ', process_name, ' 的运行日志 。。。。。。\n') 116 | print('开始时间为: ', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n\n') 117 | 118 | def write(self, message): 119 | self.terminal.write(message) 120 | self.log.write(message) 121 | 122 | def flush(self): 123 | pass 124 | 125 | 126 | -------------------------------------------------------------------------------- /resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/勾选.svg 4 | icons/1246348342.png 5 | icons/453453542155.png 6 | icons/arrow-down-bold.svg 7 | icons/arrow-right-bold.svg 8 | icons/chrome.svg 9 | icons/Excel.svg 10 | icons/菜单.svg 11 | icons/分类.svg 12 | icons/更多.svg 13 | icons/关闭 (1).svg 14 | icons/关闭.svg 15 | icons/减号.svg 16 | icons/箭头_向右.svg 17 | icons/箭头_向左.svg 18 | icons/警告.svg 19 | icons/清屏.svg 20 | icons/上.svg 21 | icons/设置.svg 22 | icons/双下拉箭头.svg 23 | icons/缩小.svg 24 | icons/下.svg 25 | icons/折叠-展开.svg 26 | icons/最大化-还原.svg 27 | icons/最小化.svg 28 | icons/作者.svg 29 | 30 | 31 | -------------------------------------------------------------------------------- /strategys/PingIP.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | __author__ = 'shiyinde' 4 | 5 | import random 6 | import multiprocessing 7 | import time 8 | import datetime 9 | import sys 10 | import os 11 | from ping3 import ping 12 | 13 | from read_write_file import Logger 14 | 15 | 16 | class PingIP(multiprocessing.Process): 17 | 18 | def __init__(self, args): 19 | multiprocessing.Process.__init__(self) 20 | 21 | self.index = args[0] 22 | self.dict = {} 23 | # 传入的参数存入临时字典 24 | self.dict['process_name'] = args[1]['process_name'] # 进程名 25 | self.dict['whether_self_start'] = args[1]['whether_self_start'] # 是否自动启动 26 | self.dict['client_name'] = args[1]['client_name'] # 客户名 27 | self.dict['tq_account'] = args[1]['tq_account'] # 天勤账号 28 | self.dict['tq_psd'] = args[1]['tq_psd'] # 天勤密码 29 | self.dict['futures_company'] = args[1]['futures_company'] # 期货公司 30 | self.dict['futures_account'] = args[1]['futures_account'] # 期货实盘资金账号 31 | self.dict['futures_psd'] = args[1]['futures_psd'] # 期货实盘资金密码 32 | self.dict['symbol'] = args[1]['symbol'] # 合约代码 33 | self.dict['symbol_period'] = args[1]['symbol_period'] # 合约周期 34 | self.dict['strategy'] = args[1]['strategy'] # 策略名 35 | self.dict['whether_live_trading'] = args[1]['whether_live_trading'] # 是否为实盘 36 | self.dict['whether_backtest'] = args[1]['whether_backtest'] # 是不是回测进程 37 | self.dict['whether_open_web_services'] = args[1]['whether_open_web_services'] # 是否启动web服务 38 | self.dict['web_port'] = args[1]['web_port'] # web服务端口 39 | 40 | self.dict['trading_status'] = args[1]['trading_status'] # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 41 | self.dict['orientation'] = args[1]['orientation'] # 交易方向 42 | self.dict['initial_capital'] = args[1]['initial_capital'] # 初始资金 43 | self.dict['final_capital'] = args[1]['final_capital'] # 最终资金 44 | self.dict['contract_multiples'] = args[1]['contract_multiples'] # 合约倍数 45 | self.dict['margin_rate'] = args[1]['margin_rate'] # 保证金率 46 | self.dict['stop_loss'] = args[1]['stop_loss'] # 止损点位 47 | self.dict['stop_profit'] = args[1]['stop_profit'] # 止盈点位 48 | 49 | self.dict['long_add_times'] = args[1]['long_add_times'] # 多头加仓次数 50 | self.dict['long_current_position'] = args[1]['long_current_position'] # 多头当前持仓 51 | self.dict['first_long_price'] = args[1]['first_long_price'] # 多头第一次加仓价格 52 | self.dict['first_long_deal'] = args[1]['first_long_deal'] # 多头第一次加仓数量 53 | self.dict['short_add_times'] = args[1]['short_add_times'] # 空头加仓次数 54 | self.dict['short_current_position'] = args[1]['short_current_position'] # 空头当前持仓 55 | self.dict['first_short_price'] = args[1]['first_short_price'] # 空头第一次加仓价格 56 | self.dict['first_short_deal'] = args[1]['first_short_deal'] # 空头第一次加仓数量 57 | 58 | self.dict['whether_open_line'] = args[1]['whether_open_line'] # 是否定义了开仓直线 59 | self.dict['open_line_Coordinates'] = args[1]['open_line_Coordinates'] # 开仓线坐标 60 | self.dict['whether_close_line'] = args[1]['whether_close_line'] # 是否定义了平仓直线 61 | self.dict['close_line_Coordinates'] = args[1]['close_line_Coordinates'] # 平仓线坐标 62 | 63 | self.dict['CP1'] = args[1]['CP1'] # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 64 | self.dict['CP2'] = args[1]['CP2'] # 自定义参数2 65 | self.dict['CP3'] = args[1]['CP3'] # 自定义参数3 66 | self.dict['CP4'] = args[1]['CP4'] # 自定义参数4 67 | self.dict['CP5'] = args[1]['CP5'] # 自定义参数5 68 | self.dict['CP6'] = args[1]['CP6'] # 自定义参数6 69 | self.dict['CP7'] = args[1]['CP7'] # 自定义参数7 70 | self.dict['CP8'] = args[1]['CP8'] # 自定义参数8 71 | self.dict['CP9'] = args[1]['CP9'] # 自定义参数9 72 | 73 | # print('进程 ', self.dict['process_name'], ' 传入的字典为:\n', self.dict, '\n\n') 74 | 75 | 76 | def ping_some_ip(self, host, src_addr=None): 77 | second = ping(host, src_addr=src_addr) 78 | return second 79 | 80 | 81 | def run(self): 82 | sys.stdout = Logger(process_name=str(self.dict['process_name'])) # 由 logger 类实例化的对象接管系统标准输出 83 | try: 84 | src_addr = None 85 | 86 | while True: 87 | 88 | print('PIng某个网站用来测试\n') 89 | print('子进程 ' + self.dict['process_name'] + ' 正在执行。。。') 90 | print('当前子进程pid为: ' + str(os.getpid())) 91 | result = self.ping_some_ip(str(self.dict['web_port']), src_addr) 92 | 93 | if result: 94 | print('当前index为:', self.index, '\n') 95 | print('当前进程为: ', self.dict['process_name'], '\n') 96 | print('当前时间为: ', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n') 97 | print('ping --> ', self.dict['web_port'], ' 成功, 耗时 ', result, '秒\n\n\n') 98 | 99 | else: 100 | print('当前index为:', self.index, '\n') 101 | print('当前进程为: ', self.dict['process_name'], '\n') 102 | print('当前时间为:', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n') 103 | print('ping --> ', self.dict['web_port'], ' 失败!\n\n\n') 104 | time.sleep(20) 105 | 106 | except Exception as ex: 107 | print('捕获异常: %r' % ex) 108 | sys.exit(1) # 退出程序 109 | 110 | 111 | if __name__ == '__main__': 112 | index = 0 113 | my_dict = {'process_name' : '回测-{2022.08.01-20时01分}-pingTest-DCE.i2209-15min', # 进程的名称,主要用于区分进程,还有日志文件的命名 114 | 'client_name' : '小白兔', # 客户名称 115 | 'tq_account' : '信易帐户', # 天勤账号 116 | 'tq_psd' : '信易密码', # 天勤密码 117 | 'futures_company' : 'Z中信建投', # 期货公司 118 | 'futures_account' : '888888888', # 实盘期货资金账号 119 | 'futures_psd' : '123456789', # 实盘期货资金密码 120 | 'symbol' : 'DCE.i2209', # 合约代码 121 | 'symbol_period' : '15', # 合约周期 122 | 'strategy' : 'pingTest', # 策略名称 123 | 'whether_self_start' : 'Ture', # 是否自启动,此项只有为ture时,才会自启动,在config文件中将对应行的此项改为False,该进程就不会自启动 124 | 'whether_live_trading' : 'Flase', # 是否是实盘交易 125 | 'whether_backtest' : 'Ture', # 是否是回测 126 | 'whether_open_web_services': 'True', # 是否开启web服务 127 | 'web_port' : 'www.hao123.com', # web服务端口 128 | 129 | 'trading_status' : True, # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 130 | 'orientation' : '1', # 交易方向,1为多,-1为空 131 | 'initial_capital' : '10000', # 初始资金 132 | 'final_capital' : '10000', # 最终资金 133 | 'contract_multiples' : '100', # 合约乘数 134 | 'margin_rate' : '12', # 保证金率 135 | 'stop_loss' : '3', # 止损位 136 | 'stop_profit' : '20', # 止盈位 137 | 138 | 'long_add_times' : 0, # 多单加仓次数 139 | 'long_current_position' : 0, # 多单当前持仓 140 | 'first_long_price' : 0, # 多单第一次成交价格 141 | 'first_long_deal' : 0, # 多单第一次成交数量 142 | 'short_add_times' : 0, # 空单加仓次数 143 | 'short_current_position' : 0, # 空单当前持仓 144 | 'first_short_price' : 0, # 空单第一次成交价格 145 | 'first_short_deal' : 0, # 空单第一次成交数量 146 | 147 | 'whether_open_line' : False, # 是否定义了开仓直线 148 | 'open_line_Coordinates' : '0,0', # 开仓线坐标 149 | 'whether_close_line' : False, # 是否定义了平仓直线 150 | 'close_line_Coordinates' : '0,0', # 平仓线坐标 151 | 152 | 'CP1' : '11', # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 153 | 'CP2' : '22', # 自定义参数2 154 | 'CP3' : '33', # 自定义参数3 155 | 'CP4' : '44', # 自定义参数4 156 | 'CP5' : '55', # 自定义参数5 157 | 'CP6' : '66', # 自定义参数6 158 | 'CP7' : '77', # 自定义参数7 159 | 'CP8' : '88', # 自定义参数8 160 | 'CP9' : '99', # 自定义参数9 161 | 162 | } 163 | 164 | backtest_start_date = '2021-09-10' 165 | backtest_end_date = '2022-03-14' 166 | 167 | # 定义一个元组,用于存储index,字典和回测日期, 这个元组会在进程类初始化的时候传入 168 | backtest_tuple = (index, my_dict, backtest_start_date, backtest_end_date) 169 | 170 | t = PingIP(args=backtest_tuple) # 实例化进程类 171 | t.name = backtest_tuple[1]['process_name'] # 设置进程名称 172 | t.start() # 启动进程 173 | -------------------------------------------------------------------------------- /strategys/__pycache__/DMA_test.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/DMA_test.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/DoubleMA.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/DoubleMA.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/Example.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/Example.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/PUBU_five.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/PUBU_five.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/SingleMA.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/SingleMA.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/demo.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/demo.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/pingItem.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/pingItem.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/pingItem1.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/pingItem1.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/pingTest.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/pingTest.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/ping_test.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/ping_test.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/__pycache__/read_write_file.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/strategys/__pycache__/read_write_file.cpython-310.pyc -------------------------------------------------------------------------------- /strategys/pingTest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | __author__ = 'shiyinde' 4 | 5 | import random 6 | import multiprocessing 7 | import time 8 | import datetime 9 | import sys 10 | import os 11 | from ping3 import ping 12 | 13 | from read_write_file import Logger 14 | 15 | 16 | 17 | class pingTest(multiprocessing.Process): 18 | def __init__(self, args): 19 | multiprocessing.Process.__init__(self) 20 | 21 | self.index = args[0] 22 | self.dict = {} 23 | # 传入的参数存入临时字典 24 | self.dict['process_name'] = args[1]['process_name'] # 进程名 25 | self.dict['whether_self_start'] = args[1]['whether_self_start'] # 是否自动启动 26 | self.dict['client_name'] = args[1]['client_name'] # 客户名 27 | self.dict['tq_account'] = args[1]['tq_account'] # 天勤账号 28 | self.dict['tq_psd'] = args[1]['tq_psd'] # 天勤密码 29 | self.dict['futures_company'] = args[1]['futures_company'] # 期货公司 30 | self.dict['futures_account'] = args[1]['futures_account'] # 期货实盘资金账号 31 | self.dict['futures_psd'] = args[1]['futures_psd'] # 期货实盘资金密码 32 | self.dict['symbol'] = args[1]['symbol'] # 合约代码 33 | self.dict['symbol_period'] = args[1]['symbol_period'] # 合约周期 34 | self.dict['strategy'] = args[1]['strategy'] # 策略名 35 | self.dict['whether_live_trading'] = args[1]['whether_live_trading'] # 是否为实盘 36 | self.dict['whether_backtest'] = args[1]['whether_backtest'] # 是不是回测进程 37 | self.dict['whether_open_web_services'] = args[1]['whether_open_web_services'] # 是否启动web服务 38 | self.dict['web_port'] = args[1]['web_port'] # web服务端口 39 | 40 | self.dict['trading_status'] = args[1]['trading_status'] # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 41 | self.dict['orientation'] = args[1]['orientation'] # 交易方向 42 | self.dict['initial_capital'] = args[1]['initial_capital'] # 初始资金 43 | self.dict['final_capital'] = args[1]['final_capital'] # 最终资金 44 | self.dict['contract_multiples'] = args[1]['contract_multiples'] # 合约倍数 45 | self.dict['margin_rate'] = args[1]['margin_rate'] # 保证金率 46 | self.dict['stop_loss'] = args[1]['stop_loss'] # 止损点位 47 | self.dict['stop_profit'] = args[1]['stop_profit'] # 止盈点位 48 | 49 | self.dict['long_add_times'] = args[1]['long_add_times'] # 多头加仓次数 50 | self.dict['long_current_position'] = args[1]['long_current_position'] # 多头当前持仓 51 | self.dict['first_long_price'] = args[1]['first_long_price'] # 多头第一次加仓价格 52 | self.dict['first_long_deal'] = args[1]['first_long_deal'] # 多头第一次加仓数量 53 | self.dict['short_add_times'] = args[1]['short_add_times'] # 空头加仓次数 54 | self.dict['short_current_position'] = args[1]['short_current_position'] # 空头当前持仓 55 | self.dict['first_short_price'] = args[1]['first_short_price'] # 空头第一次加仓价格 56 | self.dict['first_short_deal'] = args[1]['first_short_deal'] # 空头第一次加仓数量 57 | 58 | self.dict['whether_open_line'] = args[1]['whether_open_line'] # 是否定义了开仓直线 59 | self.dict['open_line_Coordinates'] = args[1]['open_line_Coordinates'] # 开仓线坐标 60 | self.dict['whether_close_line'] = args[1]['whether_close_line'] # 是否定义了平仓直线 61 | self.dict['close_line_Coordinates'] = args[1]['close_line_Coordinates'] # 平仓线坐标 62 | 63 | self.dict['CP1'] = args[1]['CP1'] # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 64 | self.dict['CP2'] = args[1]['CP2'] # 自定义参数2 65 | self.dict['CP3'] = args[1]['CP3'] # 自定义参数3 66 | self.dict['CP4'] = args[1]['CP4'] # 自定义参数4 67 | self.dict['CP5'] = args[1]['CP5'] # 自定义参数5 68 | self.dict['CP6'] = args[1]['CP6'] # 自定义参数6 69 | self.dict['CP7'] = args[1]['CP7'] # 自定义参数7 70 | self.dict['CP8'] = args[1]['CP8'] # 自定义参数8 71 | self.dict['CP9'] = args[1]['CP9'] # 自定义参数9 72 | 73 | # print('进程 ', self.dict['process_name'], ' 传入的字典为:\n', self.dict, '\n\n') 74 | 75 | 76 | def ping_some_ip(self, host, src_addr=None): 77 | second = ping(host, src_addr=src_addr) 78 | return second 79 | 80 | def run(self): 81 | sys.stdout = Logger(process_name=self.dict['process_name']) # 由 logger 类实例化的对象接管系统标准输出 82 | 83 | try: 84 | 85 | src_addr = None 86 | i = 0 87 | r = int(random.random() * 100) 88 | 89 | while True: 90 | print('PingTest PingTest PingTest PingTest PingTest\n') 91 | print('子进程 ' + self.dict['process_name'] + ' 正在执行。。。') 92 | print('当前子进程pid为: ' + str(os.getpid())) 93 | i += 1 94 | result = self.ping_some_ip(str(self.dict['web_port']), src_addr) 95 | 96 | if result: 97 | print('当前index为:', self.index, '\n') 98 | print('当前进程为: ', self.dict['process_name'], ' .......循环次数为: ', i, '随机数r为: ', r, '\n') 99 | print('当前时间为: ', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n') 100 | print('ping --> ', self.dict['web_port'], ' 成功, 耗时 ', result, '秒\n\n\n') 101 | 102 | else: 103 | print('当前index为:', self.index, '\n') 104 | print('当前进程为: ', self.dict['process_name'], ' .......循环次数为: ', i, '随机数r为: ', r, '\n') 105 | print('当前时间为:', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n') 106 | print('ping --> ', self.dict['web_port'], ' 失败!\n\n\n') 107 | time.sleep(r) 108 | 109 | if i >= r: 110 | print('进程 ', self.dict['process_name'], ' 因为一些原因,已结束\n') 111 | print('结束时间为: ', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n\n' ) 112 | # 结束进程 113 | sys.exit() 114 | 115 | except Exception as ex: 116 | print('捕获异常: %r' % ex) 117 | sys.exit(1) #退出程序 118 | 119 | 120 | if __name__ == '__main__': 121 | index = 0 122 | my_dict = { 123 | 'process_name': '回测-{2022.08.01-20时01分}-pingTest-DCE.i2209-15min', # 进程的名称,主要用于区分进程,还有日志文件的命名 124 | 'client_name': '小白兔', # 客户名称 125 | 'tq_account': '信易帐户', # 天勤账号 126 | 'tq_psd': '信易密码', # 天勤密码 127 | 'futures_company': 'Z中信建投', # 期货公司 128 | 'futures_account': '888888888', # 实盘期货资金账号 129 | 'futures_psd': '123456789', # 实盘期货资金密码 130 | 'symbol': 'DCE.i2209', # 合约代码 131 | 'symbol_period': '15', # 合约周期 132 | 'strategy': 'pingTest', # 策略名称 133 | 'whether_self_start': 'Ture', # 是否自启动,此项只有为ture时,才会自启动,在config文件中将对应行的此项改为False,该进程就不会自启动 134 | 'whether_live_trading': 'Flase', # 是否是实盘交易 135 | 'whether_backtest': 'Ture', # 是否是回测 136 | 'whether_open_web_services': 'True', # 是否开启web服务 137 | 'web_port': 'www.hao123.com', # web服务端口 138 | 139 | 'trading_status' : True, # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 140 | 'orientation': '1', # 交易方向,1为多,-1为空 141 | 'initial_capital': '10000', # 初始资金 142 | 'final_capital': '10000', # 最终资金 143 | 'contract_multiples': '100', # 合约乘数 144 | 'margin_rate': '12', # 保证金率 145 | 'stop_loss': '3', # 止损位 146 | 'stop_profit': '20', # 止盈位 147 | 148 | 'long_add_times': 0, # 多单加仓次数 149 | 'long_current_position': 0, # 多单当前持仓 150 | 'first_long_price': 0, # 多单第一次成交价格 151 | 'first_long_deal': 0, # 多单第一次成交数量 152 | 'short_add_times': 0, # 空单加仓次数 153 | 'short_current_position': 0, # 空单当前持仓 154 | 'first_short_price': 0, # 空单第一次成交价格 155 | 'first_short_deal': 0, # 空单第一次成交数量 156 | 157 | 'whether_open_line' : False, # 是否定义了开仓直线 158 | 'open_line_Coordinates' : '0,0', # 开仓线坐标 159 | 'whether_close_line' : False, # 是否定义了平仓直线 160 | 'close_line_Coordinates': '0,0', # 平仓线坐标 161 | 162 | 'CP1': '11', # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 163 | 'CP2': '22', # 自定义参数2 164 | 'CP3': '33', # 自定义参数3 165 | 'CP4': '44', # 自定义参数4 166 | 'CP5': '55', # 自定义参数5 167 | 'CP6': '66', # 自定义参数6 168 | 'CP7': '77', # 自定义参数7 169 | 'CP8': '88', # 自定义参数8 170 | 'CP9': '99', # 自定义参数9 171 | 172 | } 173 | 174 | backtest_start_date = '2021-09-10' 175 | backtest_end_date = '2022-03-14' 176 | 177 | # 定义一个元组,用于存储index,字典和回测日期, 这个元组会在进程类初始化的时候传入 178 | backtest_tuple = (index, my_dict, backtest_start_date, backtest_end_date) 179 | 180 | t = pingTest(args=backtest_tuple) # 实例化进程类 181 | t.name = backtest_tuple[1]['process_name'] # 设置进程名称 182 | t.start() # 启动进程 183 | -------------------------------------------------------------------------------- /strategys/read_write_file.py: -------------------------------------------------------------------------------- 1 | # # coding:utf-8 2 | 3 | import sys 4 | import os 5 | import time 6 | import datetime 7 | 8 | import pandas as pd 9 | 10 | 11 | class ReadWriteCsv(object): # csv文件读写类 12 | 13 | def add_dict_to_csv(self, my_df, path): 14 | data = self.read_csv_file(path) 15 | data = pd.concat([data, my_df], ignore_index=True) 16 | 17 | self.write_datas_to_csv_file(data, path) 18 | print('数据已存入config文件') 19 | 20 | 21 | def read_csv_file(self, path): 22 | df = pd.read_csv(path, engine='python', index_col=0) 23 | 24 | return df 25 | 26 | 27 | def write_datas_to_csv_file(self, df_tmp, path, encoding='utf_8_sig', index=False): 28 | df = pd.DataFrame(df_tmp) 29 | df.to_csv(path, encoding=encoding) 30 | 31 | 32 | def judge_dirs_exist(self, dirs): # 判断目录是否存在 33 | 34 | if not os.path.exists(dirs): 35 | os.makedirs(dirs) 36 | print('文件目录' + dirs + '不存在,已创建') 37 | else: 38 | pass 39 | 40 | 41 | def judge_file_exist(self, path): # 判断文件是否存在 42 | 43 | if not os.path.exists(path): 44 | df_tmp = pd.DataFrame() 45 | self.write_datas_to_csv_file(df_tmp, path) 46 | print('文件' + path + '不存在,已创建空白文件') 47 | else: 48 | pass 49 | 50 | 51 | class ReadWriteExcel(object): # excel文件读写类 52 | 53 | def add_dict_to_excel(self, my_df, path): 54 | data = self.read_excel_file(path) 55 | data = pd.concat([data, my_df], ignore_index=True) 56 | 57 | self.write_config_file(data, path) 58 | print('数据已存入config文件') 59 | 60 | def read_excel_file(self, path): 61 | df = pd.read_excel(path,index_col=0) 62 | return df 63 | 64 | def write_config_file(self, df_tmp, path, encoding='utf-8',index=False): 65 | df = pd.DataFrame(df_tmp) 66 | df.to_excel(path) 67 | 68 | def judge_config_exist(self, path): 69 | dirs = './data/' 70 | if not os.path.exists(dirs): 71 | os.makedirs(dirs) 72 | print('文件目录' + dirs + '不存在,已创建') 73 | else: 74 | pass 75 | 76 | if not os.path.exists(path): 77 | df_tmp = pd.DataFrame() 78 | self.write_config_file(df_tmp, path) 79 | print('文件' + path + '不存在,已创建空白文件') 80 | else: 81 | print('文件' + path + '存在') 82 | 83 | 84 | class Logger(object): # 日志记录类 85 | def __init__(self, process_name): 86 | 87 | self.path = "./log/" + process_name + '/' # 在log目录下创建以 process_name 命名的文件夹 88 | self.log_filename = datetime.datetime.now().strftime('%Y_%m_%d') + '.log' # 日志文件名,以当前日期为名 89 | self.terminal = sys.stdout 90 | 91 | # 检查self.path是否存在,不存在则创建 92 | if not os.path.exists(self.path): 93 | os.makedirs(self.path) 94 | # 检查self.path下是否存在self.log_filename文件,不存在则创建空白文件 95 | if not os.path.exists(self.path + self.log_filename): 96 | with open(self.path + self.log_filename, 'w') as f: 97 | f.write('') 98 | 99 | print('空白日志文件已创建,路径为:' + self.path + self.log_filename) 100 | 101 | # 打开self.path下的self.log_filename文件,并写入日志 102 | self.log = open(os.path.join(self.path, self.log_filename), "a", buffering = 1, encoding='utf8',) 103 | 104 | 105 | # open(file, ‘w’, buffering = a) 中,buffering设置缓冲行为 106 | # 全缓冲: a 是正整数,当缓冲区文件大小达到a大小时候,写入磁盘 107 | # 行缓冲: buffering = 1, 缓冲区碰到 \n 换行符的时候就写入磁盘 108 | # 无缓冲:buffering = 0 ,写多少,存多少 109 | 110 | 111 | print('*' * 40,' ', self.log_filename, ' ', '*' * 40) 112 | print('\n') 113 | print('开始记录 ', process_name, ' 的运行日志 。。。。。。\n') 114 | print('开始时间为: ', time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '\n\n') 115 | 116 | def write(self, message): 117 | self.terminal.write(message) 118 | self.log.write(message) 119 | 120 | def flush(self): 121 | pass 122 | 123 | 124 | -------------------------------------------------------------------------------- /test/传入的元组示范.py: -------------------------------------------------------------------------------- 1 | p = (0, # 元组第一个元素index,为进程的索引,为config.csv中的行号,从0开始,主要用于策略进程往config文件中回写数据时寻找对应的行 2 | 3 | { # 元组第二个元素dict,为一个字典,config.csv中的每一行数据读出来都是一个字典,回写到config文件中的时候,也是一个同样的字典 4 | 5 | 'process_name': '回测{2022-08-01 20:01:51}pingTest/DCE.i2209/15min', # 进程的名称,主要用于区分进程,还有日志文件的命名 6 | 'client_name': ' ', # 客户名称 7 | 'whether_self_start': 'Ture', # 是否自启动,此项只有为ture时,才会自启动,在config文件中将对应行的此项改为False,该进程就不会自启动 8 | 'tq_account': 'hujefeg', # 天勤账号 9 | 'tq_psd': 'hsdhjksfsd', # 天勤密码 10 | 'futures_company': 'Z中信期货', # 期货公司 11 | 'futures_account': 'sdlkfgsdg', # 实盘期货资金账号 12 | 'futures_psd': '4545655', # 实盘期货资金密码 13 | 'symbol': 'DCE.i2209', # 合约代码 14 | 'symbol_period': '15', # 合约周期 15 | 'strategy': 'pingTest', # 策略名称 16 | 'whether_live_trading': 'Flase', # 是否是实盘交易 17 | 'whether_backtest': 'Ture', # 是否是回测 18 | 'whether_open_web_services': 'True', # 是否开启web服务 19 | 'web_port': '9797', # web服务端口 20 | 21 | 'trading_status' : True, # 交易状态标志位,默认True为正常交易,Flase为停止交易,可在策略中通过开关此位来停止或开启交易 22 | 'orientation': '1', # 交易方向,1为多,-1为空 23 | 'initial_capital': '10000', # 初始资金 24 | 'final_capital': '10000', # 最终资金 25 | 'contract_multiples': '100', # 合约乘数 26 | 'margin_rate': '12', # 保证金率 27 | 'stop_loss': '3', # 止损位 28 | 'stop_profit': '20', # 止盈位 29 | 30 | 'long_add_times': 0, # 多单加仓次数 31 | 'long_current_position': 0, # 多单当前持仓 32 | 'first_long_price': 0, # 多单第一次成交价格 33 | 'first_long_deal': 0, # 多单第一次成交数量 34 | 'short_add_times': 0, # 空单加仓次数 35 | 'short_current_position': 0, # 空单当前持仓 36 | 'first_short_price': 0, # 空单第一次成交价格 37 | 'first_short_deal': 0, # 空单第一次成交数量 38 | 39 | 'whether_open_line' : False, # 是否定义了开仓直线 40 | 'open_line_Coordinates' : '0,0', # 开仓线坐标 41 | 'whether_close_line' : False, # 是否定义了平仓直线 42 | 'close_line_Coordinates' : '0,0', # 平仓线坐标 43 | 44 | 'CP1': '11', # 自定义参数1 Customized_parameters 为了方便使用,缩写为CP 45 | 'CP2': '22', # 自定义参数2 46 | 'CP3': '33', # 自定义参数3 47 | 'CP4': '44', # 自定义参数4 48 | 'CP5': '55', # 自定义参数5 49 | 'CP6': '66', # 自定义参数6 50 | 'CP7': '77', # 自定义参数7 51 | 'CP8': '88' # 自定义参数8 52 | 53 | }, 54 | 55 | '2022-02-15', '2022-08-01' # 元组第三和第四个元素,为回测开始日期和结束日期 56 | # 正常运行的策略,传入的元组只需要第一第二个元素,第三和第四个元素直接不要即可,只有在回测时才需要 57 | ) 58 | #传入回测的元组为: 59 | -------------------------------------------------------------------------------- /test/官方双均线.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | __author__ = 'limin' 4 | 5 | ''' 6 | 双均线策略 7 | 注: 该示例策略仅用于功能示范, 实盘时请根据自己的策略/经验进行修改 8 | ''' 9 | from tqsdk import TqApi, TqAuth, TargetPosTask, TqKq, TqBacktest 10 | from tqsdk.tafunc import ma 11 | from datetime import date 12 | import pandas as pd 13 | 14 | SHORT = 30 # 短周期 15 | LONG = 60 # 长周期 16 | SYMBOL = "SHFE.bu2209" # 合约代码 17 | 18 | #创建模拟交易api 19 | # api = TqApi(TqKq(),auth=TqAuth("你的信易帐户", "你的信易密码")) 20 | 21 | #创建回测api 22 | api = TqApi(backtest=TqBacktest(start_dt=date(2022, 5, 1), end_dt=date(2022, 8, 9)), auth=TqAuth("你的信易帐户", "你的信易密码")) 23 | 24 | print("策略开始运行") 25 | 26 | data_length = LONG + 2 # k线数据长度 27 | # "duration_seconds=60"为一分钟线, 日线的duration_seconds参数为: 24*60*60 28 | klines = api.get_kline_serial(SYMBOL, duration_seconds=60, data_length=data_length) 29 | target_pos = TargetPosTask(api, SYMBOL) 30 | 31 | # 完整打印K线数据 32 | dateframe = pd.DataFrame(klines) 33 | pd.set_option('display.max_rows', None) 34 | print(dateframe) 35 | 36 | while True: 37 | api.wait_update() 38 | 39 | if api.is_changing(klines.iloc[-1], "datetime"): # 产生新k线:重新计算SMA 40 | short_avg = ma(klines["close"], SHORT) # 短周期 41 | long_avg = ma(klines["close"], LONG) # 长周期 42 | 43 | # 均线下穿,做空 44 | if long_avg.iloc[-2] < short_avg.iloc[-2] and long_avg.iloc[-1] > short_avg.iloc[-1]: 45 | target_pos.set_target_volume(-3) 46 | print("均线下穿,做空") 47 | 48 | # 均线上穿,做多 49 | if short_avg.iloc[-2] < long_avg.iloc[-2] and short_avg.iloc[-1] > long_avg.iloc[-1]: 50 | target_pos.set_target_volume(3) 51 | print("均线上穿,做多") -------------------------------------------------------------------------------- /自启动脚本.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if "%1" == "h" goto begin 3 | mshta vbscript:createobject("wscript.shell").run("""%~0"" h",0)(window.close)&&exit 4 | :begin 5 | C: 6 | cd C:\Users\shiyi\Desktop\ProcessTrader 7 | python main.py 8 | -------------------------------------------------------------------------------- /进程交易者简介.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyindebcd/ProcessTrader/42f8b3cc832ae01f0a51e3a6f1223219c5829be5/进程交易者简介.pptx --------------------------------------------------------------------------------