HikyuuTdx 数据导入时增加警告弹窗

This commit is contained in:
fasiondog 2024-11-23 17:14:17 +08:00
parent 5cf188440b
commit b4e53ee99d

View File

@ -711,6 +711,14 @@ class MyMainWindow(QMainWindow, Ui_MainWindow):
QMessageBox.about(self, "错误", str(e))
return
now = hikyuu.Datetime.now()
today = hikyuu.Datetime.today()
if now.day_of_week() not in (0, 6) and hikyuu.TimeDelta(0, 8, 30) < now - today < hikyuu.TimeDelta(0, 15, 45):
reply = QMessageBox.question(self, '警告', '交易日8:30-15:45分之间导入数据将导致盘后数据错误是否仍要继续执行导入?',
QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.No:
return
self.import_running = True
self.start_import_pushButton.setEnabled(False)
self.reset_progress_bar()