Skip to content

Commit

Permalink
refactor rqalpha_data_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricporter committed Apr 18, 2017
1 parent a1cfb9c commit cde8aff
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions funcat/data/rqalpha_data_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ def get_price(self, order_book_id, start, end, freq):
if bars is None or len(bars) == 0:
raise KeyError("empty bars {}".format(order_book_id))
bars = bars.copy()
origin_bars = bars = bars.astype([
('datetime', '<u8'), ('open', '<f8'), ('close', '<f8'),
('high', '<f8'), ('low', '<f8'), ('volume', '<f8'), ('total_turnover', '<f8')])

dtype = copy.deepcopy(bars.dtype)
names = list(dtype.names)
names[0] = "date"
dtype.names = names
bars = np.array(bars, dtype=dtype)

bars["date"] = origin_bars["datetime"] / 1000000
bars = rfn.append_fields(bars, "time", np.zeros(len(bars), dtype="<u8"), usemask=False)

return bars

Expand Down

0 comments on commit cde8aff

Please sign in to comment.