Skip to content

Commit

Permalink
Refine time conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 28, 2023
1 parent 626abfb commit 113ef27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nautilus_trader/config/backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from nautilus_trader.config.common import NautilusConfig
from nautilus_trader.config.common import NautilusKernelConfig
from nautilus_trader.config.common import RiskEngineConfig
from nautilus_trader.core.datetime import maybe_dt_to_unix_nanos
from nautilus_trader.core.datetime import dt_to_unix_nanos
from nautilus_trader.model.data import Bar
from nautilus_trader.model.identifiers import ClientId
from nautilus_trader.persistence.catalog.parquet import ParquetDataCatalog
Expand Down Expand Up @@ -110,13 +110,13 @@ def query(self) -> dict[str, Any]:
def start_time_nanos(self) -> int:
if self.start_time is None:
return 0
return maybe_dt_to_unix_nanos(pd.Timestamp(self.start_time))
return dt_to_unix_nanos(self.start_time)

@property
def end_time_nanos(self) -> int:
if self.end_time is None:
return sys.maxsize
return maybe_dt_to_unix_nanos(pd.Timestamp(self.end_time))
return dt_to_unix_nanos(self.end_time)

def catalog(self) -> ParquetDataCatalog:
from nautilus_trader.persistence.catalog.parquet import ParquetDataCatalog
Expand Down

0 comments on commit 113ef27

Please sign in to comment.