[Mod] flake8 code improve
This commit is contained in:
parent
2e2b2f7510
commit
4450ccd2be
@ -188,7 +188,7 @@ texinfo_documents = [
|
|||||||
|
|
||||||
# -- Options for intersphinx output ----------------------------------------------
|
# -- Options for intersphinx output ----------------------------------------------
|
||||||
intersphinx_mapping = {
|
intersphinx_mapping = {
|
||||||
#'python': ('https://docs.python.org/3/', None),
|
# 'python': ('https://docs.python.org/3/', None),
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- Options for Epub output -------------------------------------------------
|
# -- Options for Epub output -------------------------------------------------
|
||||||
@ -211,4 +211,4 @@ epub_exclude_files = ['search.html']
|
|||||||
autodoc_default_options = {
|
autodoc_default_options = {
|
||||||
'member-order': 'bysource',
|
'member-order': 'bysource',
|
||||||
'undoc-members': True,
|
'undoc-members': True,
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ class BacktesterManager(QtWidgets.QWidget):
|
|||||||
form.addRow("合约乘数", self.size_line)
|
form.addRow("合约乘数", self.size_line)
|
||||||
form.addRow("价格跳动", self.pricetick_line)
|
form.addRow("价格跳动", self.pricetick_line)
|
||||||
form.addRow("回测资金", self.capital_line)
|
form.addRow("回测资金", self.capital_line)
|
||||||
|
|
||||||
left_vbox = QtWidgets.QVBoxLayout()
|
left_vbox = QtWidgets.QVBoxLayout()
|
||||||
left_vbox.addLayout(form)
|
left_vbox.addLayout(form)
|
||||||
left_vbox.addWidget(backtesting_button)
|
left_vbox.addWidget(backtesting_button)
|
||||||
@ -153,19 +153,19 @@ class BacktesterManager(QtWidgets.QWidget):
|
|||||||
self.chart.setMinimumWidth(1000)
|
self.chart.setMinimumWidth(1000)
|
||||||
|
|
||||||
self.trade_dialog = BacktestingResultDialog(
|
self.trade_dialog = BacktestingResultDialog(
|
||||||
self.main_engine,
|
self.main_engine,
|
||||||
self.event_engine,
|
self.event_engine,
|
||||||
"回测成交记录",
|
"回测成交记录",
|
||||||
BacktestingTradeMonitor
|
BacktestingTradeMonitor
|
||||||
)
|
)
|
||||||
self.order_dialog = BacktestingResultDialog(
|
self.order_dialog = BacktestingResultDialog(
|
||||||
self.main_engine,
|
self.main_engine,
|
||||||
self.event_engine,
|
self.event_engine,
|
||||||
"回测委托记录",
|
"回测委托记录",
|
||||||
BacktestingOrderMonitor
|
BacktestingOrderMonitor
|
||||||
)
|
)
|
||||||
self.daily_dialog = BacktestingResultDialog(
|
self.daily_dialog = BacktestingResultDialog(
|
||||||
self.main_engine,
|
self.main_engine,
|
||||||
self.event_engine,
|
self.event_engine,
|
||||||
"回测每日盈亏",
|
"回测每日盈亏",
|
||||||
DailyResultMonitor
|
DailyResultMonitor
|
||||||
@ -263,7 +263,7 @@ class BacktesterManager(QtWidgets.QWidget):
|
|||||||
if result:
|
if result:
|
||||||
self.statistics_monitor.clear_data()
|
self.statistics_monitor.clear_data()
|
||||||
self.chart.clear_data()
|
self.chart.clear_data()
|
||||||
|
|
||||||
self.trade_button.setEnabled(False)
|
self.trade_button.setEnabled(False)
|
||||||
self.order_button.setEnabled(False)
|
self.order_button.setEnabled(False)
|
||||||
self.daily_button.setEnabled(False)
|
self.daily_button.setEnabled(False)
|
||||||
@ -892,8 +892,8 @@ class BacktestingResultDialog(QtWidgets.QDialog):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
main_engine: MainEngine,
|
main_engine: MainEngine,
|
||||||
event_engine: EventEngine,
|
event_engine: EventEngine,
|
||||||
title: str,
|
title: str,
|
||||||
table_class: QtWidgets.QTableWidget
|
table_class: QtWidgets.QTableWidget
|
||||||
@ -930,7 +930,7 @@ class BacktestingResultDialog(QtWidgets.QDialog):
|
|||||||
def update_data(self, data: list):
|
def update_data(self, data: list):
|
||||||
""""""
|
""""""
|
||||||
self.updated = True
|
self.updated = True
|
||||||
|
|
||||||
data.reverse()
|
data.reverse()
|
||||||
for obj in data:
|
for obj in data:
|
||||||
self.table.insert_new_row(obj)
|
self.table.insert_new_row(obj)
|
||||||
@ -938,4 +938,3 @@ class BacktestingResultDialog(QtWidgets.QDialog):
|
|||||||
def is_updated(self):
|
def is_updated(self):
|
||||||
""""""
|
""""""
|
||||||
return self.updated
|
return self.updated
|
||||||
|
|
||||||
|
@ -1039,6 +1039,7 @@ class BacktestingEngine:
|
|||||||
"""
|
"""
|
||||||
return list(self.daily_results.values())
|
return list(self.daily_results.values())
|
||||||
|
|
||||||
|
|
||||||
class DailyResult:
|
class DailyResult:
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user