7cbf66006434c859e4ba7f0d4de816fce1532d72,QUANTAXIS/QAData/base_datastruct.py,_quotation_base,get_bar,#_quotation_base#Any#Any#Any#,782

Before Change



    def get_bar(self, code, time, if_trade=True):
        if self.type[-3:] in ["day"]:
            return self.new(self.query("code=="{}" & date=="{}"".format(code, str(time)[0:10])).set_index(["date", "code"], drop=False), self.type, self.if_fq)

        elif self.type[-3:] in ["min"]:
            return self.new(self.query("code=="{}"".format(code))[self.data["datetime"] == str(time)].set_index(["datetime", "code"], drop=False), self.type, self.if_fq)

After Change


        // elif self.type[-3:] in ["min"]:
        //     return self.new(self.query("code=="{}"".format(code))[self.data["datetime"] == str(time)].set_index(["datetime", "code"], drop=False), self.type, self.if_fq)
        try:
            return self.new(self.data.loc[pd.Timestamp(time), code], self.type, self.if_fq)
        except:
            raise ValueError(
                "DATASTRUCT CURRENTLY CANNOT FIND THIS BAR WITH {} {}".format(code, time))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7cbf66006434c859e4ba7f0d4de816fce1532d72
Time: 2018-06-01
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/base_datastruct.py
Class Name: _quotation_base
Method Name: get_bar


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 7cbf66006434c859e4ba7f0d4de816fce1532d72
Time: 2018-06-01
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/base_datastruct.py
Class Name: _quotation_base
Method Name: select_code


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 27ffa988ebeead4044695d58642b628083382d6c
Time: 2018-07-29
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAMarket/QAMarket.py
Class Name: QA_Market
Method Name: query_order