Skip to content

Commit 9ab7207

Browse files
author
yutiansut
committed
#
1 parent 2c9679c commit 9ab7207

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

QUANTAXIS/QAWebServer/qifiserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from QUANTAXIS.QIFI.QifiManager import QA_QIFIMANAGER, QA_QIFISMANAGER
66
class QAQIFI_Handler(QABaseHandler):
77
#manager = QA_QIFIMANAGER(mongo_ip)
8-
manager = QA_QIFISMANAGER(mongo_ip)
8+
manager = QA_QIFISMANAGER(mongo_ip,model='REALTIME')
99

1010
def get(self):
1111
action = self.get_argument('action', 'acchistory')
@@ -99,7 +99,7 @@ def get(self):
9999

100100
class QAQIFIS_Handler(QABaseHandler):
101101
#manager = QA_QIFIMANAGER(mongo_ip)
102-
manager = QA_QIFISMANAGER(mongo_ip)
102+
manager = QA_QIFISMANAGER(mongo_ip,model='REALTIME')
103103

104104
def get(self):
105105
action = self.get_argument('action', 'acchistory')

QUANTAXIS/QIFI/QifiManager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ def query_re(self, text) -> list:
171171

172172
def get_portfolio_panel(self, portfolio) -> pd.DataFrame:
173173
r = self.get_portfolio_account(portfolio)
174+
174175
rp = [self.database.find_one({'account_cookie': i}, {
175176
"accounts": 1, 'trading_day': 1, '_id': 0}) for i in r]
176-
return pd.DataFrame([mergex(i['accounts'], {'trading_day': i['trading_day']}) for i in rp])
177+
return pd.DataFrame([mergex(i['accounts'], {'trading_day': i['trading_day']}) for i in rp]).query('user_id in {}'.format(r))
177178

178179
def get_allaccountname(self) -> list:
179180
return list(set([i['account_cookie'] for i in self.database.find({}, {'account_cookie': 1, '_id': 0})]))

0 commit comments

Comments
 (0)