Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minute timeframe plotting market open at 13:30 but ending the day at 16:00 #180

Open
mkaicher opened this issue Jul 27, 2021 · 1 comment

Comments

@mkaicher
Copy link

mkaicher commented Jul 27, 2021

Hello all. I've been working with the example code and for some reason when using Minutes granularity, I'm getting plots with market open data at 13:30, and a premature end a 16:00. This happens even if I extend my fromdate/todate datetime parameters to include hours, minutes, tzinfo, etc. I've also tried swapping trading_calendars for exchange_calendars. What am I missing?? Thanks.

Update: I should acknowledge up front that I'm a complete noob, however, I've managed to get charts with the full expected data by doing the following:

  1. Rolled back alpaca-backtrader-api to version 0.13.0
  2. In /anaconda3/envs/backtrader/lib/python3.8/site-packages/trading_calendars/calendar_helpers.py
    #NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
    NP_NAT = pd.NaT.value
  3. When calling alpaca_backtrader_api.AlpacaData, to get a full regular session of 1 minute data, I had to specify 9:30 for fromdate (UTC-4) and 20:00 for todate (UTC).

Clearly there's something amiss with the timezones.

@datatalking
Copy link

@mkaicher Thanks for posting the issue, when you say 'Rolled back alpaca-backtrader-api to version 0.13.0` can you explain that process or thinking. Version control is something I need to learn more on and I'm digging into alpaca to help debug issues like this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants