-
Notifications
You must be signed in to change notification settings - Fork 224
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
404 error #14
Comments
I also have this issue using Python 3.8.2. Tried changing the HTTP endpoints in the rest.py, but have not been able to get it to work. Using Postman, I can GET and POST to Alpaca using |
I'm also having this same issue: |
This may be completely wrong, but I believe the V2 looks like this: Updated polygon code. The API now has a v2 function: |
This was the fix. Nice work, and thank you.
It was running up until this error occurred: TypeError: 'NoneType' object
is not iterable
…On Tue, Apr 7, 2020 at 1:36 PM erod998 ***@***.***> wrote:
This may be completely wrong, but I believe the V2 looks like this:
Calling API:
minute_history[symbol] = api.polygon.historic_agg_v2( timespan="minute",
symbol=symbol, limit=1000, multiplier=1, _from='2020-04-05',
to='2020-04-06' ).df
Updated polygon
<https://github.com/alpacahq/alpaca-trade-api-python/tree/master/alpaca_trade_api/polygon>
code.
The API now has a v2 function:
def historic_agg_v2(self, symbol, multiplier, timespan, _from, to,
unadjusted=False, limit=None): path =
'/aggs/ticker/{}/range/{}/{}/{}/{}'.format( symbol, multiplier, timespan,
_from, to ) params = {} params['unadjusted'] = unadjusted if limit:
params['limit'] = limit raw = self.get(path, params, version='v2') return
Aggsv2(raw)
Obviously the dates cannot be hardcoded into the api call but I was
testing it, I don't know if this is the right step in the right direction.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDXXXX56AZESLQRCTQQOMTRLNQAHANCNFSM4LWUVQLA>
.
|
I also got that error. Can't figure it out yet as it does not happen each time the algo is ran. I am not sure if the GET request is getting the wrong info or if the JSON isn't being parsed correctly. The current way I call the V2 API is incredibly slow. Not sure if it is the code or if its limitations of the API. Takes about 5 minutes to populate the list of the aggregated data. This is the response from GET https://api.polygon.io/v2/aggs/ticker/AAL/range/1/minute/2020-04-01/2020-04-06?apiKey=xxxxxxxxxxxx. |
here's the code for capturing the time if that's what you were looking for?
[image: image.png]
I'm getting a different error this time. Could it be because I have it
using a paper trading API key?
…On Tue, Apr 7, 2020 at 1:44 PM erod998 ***@***.***> wrote:
I also got that error. Can't figure it out yet as it does not happen each
time the algo is ran.
Can you point me in the direction to change the time the algo starts? I
would like to do testing and have not had the chance to have the algo run
before market open.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDXXXUEIQD2ECQLPC5I2E3RLNRATANCNFSM4LWUVQLA>
.
|
Now I'm getting an error "Cannot close a running event loop." Do you have
any thoughts on this?
[image: image.png]
…On Tue, Apr 7, 2020 at 4:50 PM Aric Recker ***@***.***> wrote:
here's the code for capturing the time if that's what you were looking for?
[image: image.png]
I'm getting a different error this time. Could it be because I have it
using a paper trading API key?
On Tue, Apr 7, 2020 at 1:44 PM erod998 ***@***.***> wrote:
> I also got that error. Can't figure it out yet as it does not happen each
> time the algo is ran.
> Can you point me in the direction to change the time the algo starts? I
> would like to do testing and have not had the chance to have the algo run
> before market open.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#14 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIDXXXUEIQD2ECQLPC5I2E3RLNRATANCNFSM4LWUVQLA>
> .
>
|
Added generation of yesterday/today dates to the historical data function using
|
I am also having this issue but I can't seem to figure out what you did to fix it Getting current ticker data... |
try this: |
Getting current ticker data...
Success.
Getting list of assets...
Success.
Tracking 201 symbols.
Getting historical data...
Traceback (most recent call last):
File "C:/Users/colef/PycharmProjects/Code/Python/Momentum-Trading-Example-master/algo.py", line 400, in
run(get_tickers(), market_open, market_close)
File "C:/Users/colef/PycharmProjects/Code/Python/Momentum-Trading-Example-master/algo.py", line 90, in run
minute_history = get_1000m_history_data(symbols)
File "C:/Users/colef/PycharmProjects/Code/Python/Momentum-Trading-Example-master/algo.py", line 40, in get_1000m_history_data
size="minute", symbol=symbol, limit=1000
File "C:\Users\colef\Anaconda3\lib\site-packages\alpaca_trade_api\polygon\rest.py", line 123, in historic_agg
raw = self.get(path, params)
File "C:\Users\colef\Anaconda3\lib\site-packages\alpaca_trade_api\polygon\rest.py", line 37, in get
return self._request('GET', path, params=params, version=version)
File "C:\Users\colef\Anaconda3\lib\site-packages\alpaca_trade_api\polygon\rest.py", line 33, in _request
resp.raise_for_status()
File "C:\Users\colef\Anaconda3\lib\site-packages\requests\models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.polygon.io/v1/historic/agg/minute/ARLO?limit=1000&apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Process finished with exit code 1
Can someone please help me with this. I have a valid Brokerage account but it still gives me this error.
The text was updated successfully, but these errors were encountered: