diff --git a/vnpy/app/data_recorder/ui/widget.py b/vnpy/app/data_recorder/ui/widget.py index 44809baa..553a9d37 100644 --- a/vnpy/app/data_recorder/ui/widget.py +++ b/vnpy/app/data_recorder/ui/widget.py @@ -3,7 +3,7 @@ from datetime import datetime from vnpy.event import Event, EventEngine from vnpy.trader.engine import MainEngine -from vnpy.trader.ui import QtCore, QtGui, QtWidgets +from vnpy.trader.ui import QtCore, QtWidgets from vnpy.trader.event import EVENT_CONTRACT from ..engine import ( diff --git a/vnpy/trader/database/database_sql.py b/vnpy/trader/database/database_sql.py index 7452e467..41e54856 100644 --- a/vnpy/trader/database/database_sql.py +++ b/vnpy/trader/database/database_sql.py @@ -334,11 +334,11 @@ class SqlManager(BaseDatabaseManager): s = ( self.class_bar.select() .where( - (self.class_bar.symbol == symbol) & - (self.class_bar.exchange == exchange.value) & - (self.class_bar.interval == interval.value) & - (self.class_bar.datetime >= start) & - (self.class_bar.datetime <= end) + (self.class_bar.symbol == symbol) + & (self.class_bar.exchange == exchange.value) + & (self.class_bar.interval == interval.value) + & (self.class_bar.datetime >= start) + & (self.class_bar.datetime <= end) ) .order_by(self.class_bar.datetime) ) @@ -351,10 +351,10 @@ class SqlManager(BaseDatabaseManager): s = ( self.class_tick.select() .where( - (self.class_tick.symbol == symbol) & - (self.class_tick.exchange == exchange.value) & - (self.class_tick.datetime >= start) & - (self.class_tick.datetime <= end) + (self.class_tick.symbol == symbol) + & (self.class_tick.exchange == exchange.value) + & (self.class_tick.datetime >= start) + & (self.class_tick.datetime <= end) ) .order_by(self.class_tick.datetime) ) @@ -376,9 +376,9 @@ class SqlManager(BaseDatabaseManager): s = ( self.class_bar.select() .where( - (self.class_bar.symbol == symbol) & - (self.class_bar.exchange == exchange.value) & - (self.class_bar.interval == interval.value) + (self.class_bar.symbol == symbol) + & (self.class_bar.exchange == exchange.value) + & (self.class_bar.interval == interval.value) ) .order_by(self.class_bar.datetime.desc()) .first() @@ -393,8 +393,8 @@ class SqlManager(BaseDatabaseManager): s = ( self.class_tick.select() .where( - (self.class_tick.symbol == symbol) & - (self.class_tick.exchange == exchange.value) + (self.class_tick.symbol == symbol) + & (self.class_tick.exchange == exchange.value) ) .order_by(self.class_tick.datetime.desc()) .first()