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

Timestamps not unique when using RESTClient.list_aggs #590

Open
aleathwick opened this issue Jan 12, 2024 · 2 comments
Open

Timestamps not unique when using RESTClient.list_aggs #590

aleathwick opened this issue Jan 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working data

Comments

@aleathwick
Copy link

Describe the bug
I expected that results from RESTClient.list_aggs() would return only one result per timestamp. That is what I have observed most of the time, but I've found some exceptions. Apologies if I misunderstand something and this behaviour is expected.

To Reproduce
An example with multiple results per timestamp:

import polygon
client = polygon.RESTClient(api_key='insert_api_key_here')
aggs = []
for a in client.list_aggs(ticker='X:BTC-USD', multiplier=1, timespan='minute', from_=1664871240000 - 10, to=1664871240000 + 10):
    aggs.append(a)
aggs

from collections import Counter
Counter((a.timestamp for a in aggs))

Output:
Counter({1664871240000: 57, 1664871180000: 14})
I.e. there 57 entries for timestamp 1664871240000, and 14 with timestamp 1664871180000.
Each entry has different attributes, i.e. different open, high, low, close etc.

Expected behavior
I would have expected a single aggregate per timestamp.

Screenshots
image

@aleathwick aleathwick added the bug Something isn't working label Jan 12, 2024
@justinpolygon
Copy link
Contributor

@aleathwick thanks for reporting this. We're checking it out now. Also, thanks for the triage @qrpike.

@jbonilla-tao
Copy link

@justinpolygon i observed this happened for crypto websocket data (XAS.*).
Duplicate timestamps maybe from different exchanges?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data
Projects
None yet
Development

No branches or pull requests

4 participants