mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 05:05:48 +08:00
BUG: Fix mismatch of stored benchmark timestamps.
Normalize the date, so that there is not an EST/EDT and UTC mismatch.
This commit is contained in:
@@ -21,6 +21,7 @@ import csv
|
||||
from functools import partial
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
|
||||
from . loader_utils import (
|
||||
date_conversion,
|
||||
@@ -126,7 +127,8 @@ def get_benchmark_returns(symbol, start_date=None, end_date=None):
|
||||
else:
|
||||
prev_close = data_points[i - 1]['close']
|
||||
returns = (data_point['close'] - prev_close) / prev_close
|
||||
daily_return = DailyReturn(date=data_point['date'], returns=returns)
|
||||
date = pd.tseries.tools.normalize_date(data_point['date'])
|
||||
daily_return = DailyReturn(date=date, returns=returns)
|
||||
benchmark_returns.append(daily_return)
|
||||
|
||||
return benchmark_returns
|
||||
|
||||
Reference in New Issue
Block a user