Closed x777 closed 3 years ago
Nevermind, it didn't work. The market was just closed :/
Yes that's how I found this, the issues page. I saw this guy had the same issue but it doesn't seem like it was ever resolved.
I changed usePolygon to False and didn't get the error anymore. Idk what it uses if not polygon though. Maybe this is a polygon related error? I don't have money in my real $$ account yet, it's pending, so maybe I can't use polygon yet. I sent $5 to it to see if that's why i'm having this issue.
we have 2 data sources - polygon and alpaca. you can only use the polygon data source if you have a funded account the alpaca data source is free
You know what, it's not Polygon. It's something wrong with my strategy. I tried one of the sample strategies and it works fine with polygon and paper trading. I didn't find the problem specifically but it was an error on my part in the strategy. Thanks for the quick responses though!
I'm trying to use 5 minute candles but this code seems to be giving me that sleep 3 seconds and retrying error:
TRADE_LIVE = True
TICKER_SYMBOL = 'AAPL'
CHART_RESOLUTION = 5
BACKTEST_START_MONTH = 1
BACKTEST_START_DAY = 1
BACKTEST_START_YEAR = 2019
When I change bt.TimeFrame.Minutes to Days the error goes away...so seems to be something to do with bt.TimeFrame.Minutes
I think this is where it's supposed to go:
you are trying to get minute data for a year and a half, that could be a problem. check the docs, to see if you can find the limitations (polygon docs if you're using polygon and alpaca's docs otherwise)
OH that makes sense. I have had problems doing that with other frameworks too. Thanks I have been really frustrated trying to figure this out.
Actually i'm not sure if that was even the problem. I deleted all alpaca and backtrader folders, everything related to either of them, then just unzipped this back into the same folder and now it no longer gives me that error. Very odd. I had an alpaca api folder as well (without backtrader) and I think that was somehow conflicting with this.
maybe you installed things under the same virtual environment. try using a clean virtual env
closing due to lack of activity
I try paper trading with my own live feed using alpaca-backtrader-api. When I do resample for this data feed, I received message:
sleep 3 seconds and retrying https://paper-api.alpaca.markets/v2/account 3 more time(s)…
Sometimes it starts normally, but often no at all.
When disable alpaca broker, data feed working well.