Skip to content

Commit

Permalink
upgrade PartialBarObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuizi7 committed Apr 8, 2021
1 parent 66053c0 commit ae38338
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rqalpha/model/bar.py
Expand Up @@ -16,6 +16,7 @@
# 详细的授权流程,请联系 public@ricequant.com 获取。

import six
from datetime import datetime
import numpy as np

from rqalpha.core.execution_context import ExecutionContext
Expand Down Expand Up @@ -54,7 +55,10 @@ def datetime(self):
"""
if self._dt is not None:
return self._dt
return convert_int_to_datetime(self._data['datetime'])
dt = self._data["datetime"]
if isinstance(dt, datetime):
return dt
return convert_int_to_datetime(dt)

@cached_property
def instrument(self):
Expand Down

0 comments on commit ae38338

Please sign in to comment.