|
5 | 5 | from QUANTAXIS.QIFI.QifiManager import QA_QIFIMANAGER, QA_QIFISMANAGER
|
6 | 6 | class QAQIFI_Handler(QABaseHandler):
|
7 | 7 | #manager = QA_QIFIMANAGER(mongo_ip)
|
8 |
| - manager = QA_QIFISMANAGER(mongo_ip,model='REALTIME') |
| 8 | + manager = QA_QIFISMANAGER(mongo_ip,model='BACKTEST') |
9 | 9 |
|
10 | 10 | def get(self):
|
11 | 11 | action = self.get_argument('action', 'acchistory')
|
@@ -98,6 +98,43 @@ def get(self):
|
98 | 98 |
|
99 | 99 |
|
100 | 100 | class QAQIFIS_Handler(QABaseHandler):
|
| 101 | + #manager = QA_QIFIMANAGER(mongo_ip) |
| 102 | + manager = QA_QIFISMANAGER(mongo_ip,model='BACKTEST') |
| 103 | + |
| 104 | + def get(self): |
| 105 | + action = self.get_argument('action', 'acchistory') |
| 106 | + |
| 107 | + if action == 'accountlist': |
| 108 | + res = self.manager.get_allaccountname() |
| 109 | + self.write({'res': res}) |
| 110 | + elif action == 'portfoliolist': |
| 111 | + res = self.manager.get_allportfolio() |
| 112 | + self.write({'res': res}) |
| 113 | + elif action == 'accountinportfolio': |
| 114 | + portfolio = self.get_argument('portfolio', 't12') |
| 115 | + res = self.manager.get_portfolio_panel(portfolio) |
| 116 | + |
| 117 | + self.write({'res': QA_util_to_json_from_pandas(res)}) |
| 118 | + |
| 119 | + def post(self): |
| 120 | + action = self.get_argument('action', 'change_name') |
| 121 | + if action == 'drop_account': |
| 122 | + |
| 123 | + account_cookie = self.get_argument('account_cookie') |
| 124 | + res = self.manager.drop_account(account_cookie) |
| 125 | + self.write({ |
| 126 | + 'res': res, |
| 127 | + 'status': 200 |
| 128 | + }) |
| 129 | + elif action == 'drop_many': |
| 130 | + account_cookies = self.get_argument('account_cookies') |
| 131 | + res = self.manager.drop_many(account_cookies) |
| 132 | + self.write({ |
| 133 | + 'res': res, |
| 134 | + 'status': 200 |
| 135 | + }) |
| 136 | + |
| 137 | +class QAQIFIS_REALTIME_Handler(QABaseHandler): |
101 | 138 | #manager = QA_QIFIMANAGER(mongo_ip)
|
102 | 139 | manager = QA_QIFISMANAGER(mongo_ip,model='REALTIME')
|
103 | 140 |
|
|
0 commit comments