def test_freq_30m(self): df = get_price('000001.XSHG', start_date='2018-08-20', end_date=datetime(2018, 8, 31, 15), frequency='30m') assert df.index[0] == datetime(2018, 8, 20, 10) assert df.index[-1] == datetime(2018, 8, 31, 15) assert df.shape == (80, 6) return
def test_freq_1d(self): df = get_price('000001.XSHG', start_date='2018-01-01', end_date='2018-08-31', frequency='1d') assert df.index[0] == datetime(2018, 1, 2) assert df.index[-1] == datetime(2018, 8, 31) assert df.shape == (164, 6) return
def bar(self): return get_price(self.sid, self.start_date, self.end_date, self.frequency)