15ff4acfc4438dab85155acdf0b8fdb9e1292e0f,QUANTAXIS/QABacktest/QABacktest.py,QA_Backtest_stock_day,__end_of_backtest,#QA_Backtest_stock_day#,842

Before Change


            "time": datetime.datetime.now()
        }
        QA_SU_save_backtest_message(_backtest_mes, self.setting.client)
        QA_SU_save_account_message(__messages, self.setting.client)
        QA_SU_save_account_to_csv(__messages)
        // QA.QA_SU_save_backtest_message(analysis_message, self.setting.client)

    def QA_backtest_excute_bid(self, __result,  __date, __hold, __code, __amount):

After Change


        self.__benchmark_data = QA_fetch_index_day(
            self.benchmark_code, self.start_real_date,
            self.end_real_date)
        if len(self.__messages)>1:
            performace = QA_backtest_analysis_start(
                self.setting.client, self.strategy_stock_list,self.__messages,
                self.trade_list[self.start_real_id:self.end_real_id + 1],
                self.market_data, self.__benchmark_data)
            _backtest_mes = {
                "user": self.setting.QA_setting_user_name,
                "strategy": self.strategy_name,
                "stock_list": performace["code"],
                "start_time": self.strategy_start_date,
                "end_time": self.strategy_end_date,
                "account_cookie": self.account.account_cookie,
                "annualized_returns": performace["annualized_returns"],
                "benchmark_annualized_returns": performace["benchmark_annualized_returns"],
                "assets": performace["assets"],
                "benchmark_assets": performace["benchmark_assets"],
                "trade_date": performace["trade_date"],
                "total_date": performace["total_date"],
                "win_rate": performace["win_rate"],
                "alpha": performace["alpha"],
                "beta": performace["beta"],
                "sharpe": performace["sharpe"],
                "vol": performace["vol"],
                "benchmark_vol": performace["benchmark_vol"],
                "max_drop": performace["max_drop"],
                "exist": __exist_time,
                "time": datetime.datetime.now()
            }
            QA_SU_save_backtest_message(_backtest_mes, self.setting.client)
            QA_SU_save_account_message(self.__messages, self.setting.client)
            QA_SU_save_account_to_csv(self.__messages)
        // QA.QA_SU_save_backtest_message(analysis_message, self.setting.client)

    def QA_backtest_excute_bid(self, __result,  __date, __hold, __code, __amount):
        
        这里是处理报价的逻辑部分
        2017/7/19 修改
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 15ff4acfc4438dab85155acdf0b8fdb9e1292e0f
Time: 2017-08-02
Author: yutiansut@qq.com
File Name: QUANTAXIS/QABacktest/QABacktest.py
Class Name: QA_Backtest_stock_day
Method Name: __end_of_backtest


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: db55d91da808b441b8bcce0b8265f0d5d5179016
Time: 2017-05-01
Author: yutiansut@qq.com
File Name: test/test_strategy.py
Class Name: backtest
Method Name: handle_data


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7245e2483baa57d12f6bb47de9c99be3c0ad8f3e
Time: 2017-11-22
Author: yutiansut@qq.com
File Name: QUANTAXIS/QABacktest/QABacktest.py
Class Name: QA_Backtest
Method Name: __end_of_backtest