f3384d39d6eac0b43452fe4b8b96795e37f14b06,QUANTAXIS/QAARP/QAAccount.py,QA_Account,QA_account_update,#QA_Account#Any#,54

Before Change


                                    self.portfolio.pop(i)
                                    break
                            else:
                                QA_util_log_info("no code in portfolio")

                
            // 将交易记录插入历史交易记录

After Change



            else:
                //更新账户
                pop_list=[]
                while new_amount>0:
                    
                    if len(self.portfolio)>1:
                        for i in range(0,len(self.portfolio)):

                            
                            if new_code in self.portfolio[i]:
                                if new_amount>self.portfolio[i][3]:

                                    new_amount=new_amount-self.portfolio[i][3]
                                    print(new_amount)
                                    pop_list.append(i)

                                elif new_amount<self.portfolio[i][3]:
                                    self.portfolio[i][3]=self.portfolio[i][3]-new_amount
                                    new_amount=0
                                elif new_amount==self.portfolio[i][3]:
                                    
                                    new_amount=0
                                    pop_list.append(i)
                print(pop_list)
                pop_list.sort()
                pop_list.reverse()
                for id in pop_list:
                    self.portfolio.pop(id)

                
            // 将交易记录插入历史交易记录


        else:
            pass
        self.QA_account_calc_profit(update_message)
        self.message = {
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: f3384d39d6eac0b43452fe4b8b96795e37f14b06
Time: 2017-06-06
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAARP/QAAccount.py
Class Name: QA_Account
Method Name: QA_account_update


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


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 4113a6a3be19167a8c551f8ae20e849ac851e52c
Time: 2019-03-25
Author: zhongjy1992@outlook.com
File Name: QUANTAXIS/QAFetch/QAQuery.py
Class Name:
Method Name: QA_fetch_index_day