polygon-io / feature-requests

Feature requests for the Polgon.io Platform. Any bug reports should be opened in polygon-io/issues/issuess
0 stars 0 forks source link

Aggregates will return information from multiple cusips #5

Open cnuernber opened 2 years ago

cnuernber commented 2 years ago

URL https://api.polygon.io/v2/aggs/ticker/ULTR/range/1/day/2012-03-17/2022-03-17?adjusted=true&limit=50000&apiKey={...}

Result


vestedus.polygon> (def test-ds (since-date-impl "ULTR" "day" (java.time.LocalDate/parse "2012-03-17")
                                                (java.time.LocalDate/now)))
https://api.polygon.io/v2/aggs/ticker/ULTR/range/1/day/2012-03-17/2022-03-17?adjusted=true&limit=50000&apiKey={...}
#'vestedus.polygon/test-ds
vestedus.polygon> test-ds
_unnamed [1818 8]:

|           :timestamp |   :volume | :volume-weighted-average | :n-transactions |    :low |   :open |  :close |   :high |
|----------------------|----------:|-------------------------:|----------------:|--------:|--------:|--------:|--------:|
| 2012-03-19T04:00:00Z |   94694.0 |                   2.4714 |             368 |  2.4100 |  2.4100 |  2.4500 |  2.5100 |
| 2012-03-20T04:00:00Z | 1045601.0 |                   2.3942 |             853 |  2.3000 |  2.4200 |  2.3200 |  2.4400 |
| 2012-03-21T04:00:00Z |  121298.0 |                   2.2989 |             526 |  2.2500 |  2.3400 |  2.2900 |  2.3500 |
| 2012-03-22T04:00:00Z |  504113.0 |                   2.1128 |            1178 |  2.0600 |  2.2400 |  2.1300 |  2.2500 |
| 2012-03-23T04:00:00Z |  298638.0 |                   2.1287 |             665 |  2.1000 |  2.1200 |  2.1400 |  2.2100 |
| 2012-03-26T04:00:00Z |   44103.0 |                   2.1881 |             227 |  2.1504 |  2.1700 |  2.1900 |  2.2200 |
| 2012-03-27T04:00:00Z |   99757.0 |                   2.1207 |             497 |  2.0800 |  2.1900 |  2.1000 |  2.2150 |
| 2012-03-28T04:00:00Z |   62572.0 |                   2.1102 |             152 |  2.1000 |  2.1100 |  2.1000 |  2.1400 |
| 2012-03-29T04:00:00Z |  163553.0 |                   2.0131 |             542 |  1.9900 |  2.0700 |  1.9900 |  2.1100 |
| 2012-03-30T04:00:00Z |   89797.0 |                   1.9995 |             237 |  1.9800 |  2.0200 |  2.0000 |  2.0500 |
|                  ... |       ... |                      ... |             ... |     ... |     ... |     ... |     ... |
| 2022-03-02T05:00:00Z |    1475.0 |                  48.1569 |              14 | 48.1301 | 48.1700 | 48.1301 | 48.1700 |
| 2022-03-03T05:00:00Z |   36662.0 |                  48.1847 |              12 | 48.1500 | 48.7000 | 48.1800 | 48.7000 |
| 2022-03-04T05:00:00Z |    2296.0 |                  48.3091 |              26 | 48.2699 | 48.3100 | 48.2699 | 48.3100 |
| 2022-03-07T05:00:00Z |   77320.0 |                  48.1512 |              22 | 48.1400 | 48.3000 | 48.2000 | 48.3000 |
| 2022-03-08T05:00:00Z |    5671.0 |                  48.1238 |              25 | 48.0900 | 48.3000 | 48.0900 | 48.3000 |
| 2022-03-09T05:00:00Z |     487.0 |                  48.0506 |               9 | 47.9678 | 48.3000 | 48.0300 | 48.3000 |
| 2022-03-10T05:00:00Z |    2045.0 |                  47.9793 |              11 | 47.9729 | 48.0100 | 48.0102 | 48.0102 |
| 2022-03-11T05:00:00Z |     683.0 |                  48.0034 |              12 | 47.9600 | 48.0100 | 47.9600 | 48.0100 |
| 2022-03-14T04:00:00Z |   20033.0 |                  47.9463 |             182 | 47.8599 | 48.1900 | 47.9600 | 48.1900 |
| 2022-03-15T04:00:00Z |    1186.0 |                  47.9708 |              10 | 47.9300 | 47.9951 | 47.9400 | 47.9951 |
| 2022-03-16T04:00:00Z |    1128.0 |                  47.7782 |              16 | 47.4300 | 47.4300 | 47.7800 | 48.1900 |

Expected Result The ULTR ETF started around august 2019. The system is picking up some information from the ULTR etf and some information from another cusip on a different exchange that used the same ticker. What I personally would like is to only get information on the ETF. Due to issue polygon-io/issues#201 I can't use the list_date to shorten the request date ranges.

This means that in general I can't trust the aggregate call in order to build out backtesting information because it will potentially switch cusips in the same data stream.

jrbell19 commented 2 years ago

Can you please hide your API key in the request URL?

We have plans to implement a solution to ensure only the ticker you are looking for is returned, however, I do not have a concrete ETA to give you at this time.

So sorry this has troubled you!

cnuernber commented 2 years ago

Thanks for the heads up - I didn't realize it was in the dataset title additionally.

No worries - please just keep me in the loop :-).

cnuernber commented 2 years ago

If polygon-io/issues#201 is fixed this issue becomes far lower priority as I can trim the search criteria by the initial listing date.

jrbell19 commented 1 year ago

Adding the enhancement tag, as this is related to querying data tracked across the most recent active ticker, instead of returning data for all tickers associated with a ticker.

cnuernber commented 1 year ago

Any update of polygon-io/issues#201 ?