def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) fig=risk.plot_assets_curve() fig.show()
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) self.account.save() risk.save()
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) self.account.save() risk.save() risk.plot_assets_curve() print(risk.profit_construct)
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) risk.plot_assets_curve() risk.plot_dailyhold() risk.plot_signal() self.account.save() risk.save()
def after_success(self): QA_util_log_info(self.account.history_table) #check if the history_table is empty list if len(self.account.history_table) == 0: #没有交易历史记录,直接返回 return risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) self.account.save() risk.save()
def __init__(acc: QA_Account): self.acc = acc self.risk = QA_Risk(acc) self.performance = QA_Performance(acc) print(acc)
def get(self): """ 采用了get_arguent来获取参数 默认参数: code-->000001 start-->2017-01-01 09:00:00 end-->now accounts?account_cookie=xxx """ account_cookie = self.get_argument('account_cookie', default='quantaxis') portfolio_cookie = self.get_argument('portfolio_cookie') user_cookie = self.get_argument('user_cookie') action = self.get_argument('action', 'query_history') acc = QA_Account(account_cookie=account_cookie, user_cookie=user_cookie, portfolio_cookie=portfolio_cookie, auto_reload=True) if action == 'query_history': self.write({ 'status': 200, 'frequence': acc.frequence, 'market': acc.market_type, 'result': acc.history }) elif action == 'query_performance': self.write({'res': 200, 'result': QA_Performance(acc).message}) elif action == 'query_risk': self.write({'res': 200, 'result': QA_Risk(acc).message})
def after_success(self): QA_util_log_info(self.account.history_table) # check if the history_table is empty list if len(self.account.history_table) == 0: # 没有交易历史记录,直接返回 return risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) risk.plot_assets_curve() risk.plot_dailyhold() risk.plot_signal() performance = QA_Performance(self.account) performance.plot_pnlmoney(performance.pnl_fifo) performance.plot_pnlratio(performance.pnl_fifo) self.account.save() risk.save()
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account) print(risk.assets) print('annualize_return : {} %'.format(risk.annualize_return)) print('max_dropback : {} %'.format(risk.max_dropback)) print('profit : {} %'.format(risk.profit)) print('volatility : {}'.format(risk.volatility)) self.account.save()
def after_success(self): QA_util_log_info(self.account.history_table) # check if the history_table is empty list if len(self.account.history_table) == 0: # 没有交易历史记录,直接返回 return risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) risk.plot_assets_curve() risk.plot_dailyhold() risk.plot_signal() performance = QA_Performance(self.account) performance.plot_pnlmoney(performance.pnl_fifo) performance.plot_pnlratio(performance.pnl_fifo) self.account.save() risk.save()
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) self.user.save() risk.save() risk.plot_assets_curve() print(risk.profit_construct)
def after_success(self): QA_util_log_info(self.account.history_table) risk = QA_Risk(self.account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN) print(risk().T) fig=risk.plot_assets_curve() fig.show() fig=risk.plot_dailyhold() fig.show() fig=risk.plot_signal() fig.show() self.account.save() risk.save()
def evaluate(self, account): account = self.accounts[account] risk = QA_Risk(account)