Darp8
- ago
Have a system on 15mins that shorts and it very active, so can test out paper trading with it. Want to get it going today.

Is there an article, link or whatever showing doing that with Alpaca?

Here are issues.

1. Have Alpaca paper acct, WL sees it and yesterday I got live data thru streaming ffrom it, Alpaca Keys in WL already and accepted.

2. Streaming not working today. In my strategy Broker shows Alpaca, but on dropdown it just has a box for account# grayed out cannot enter. And says "not connected".

3. In Data Manager-Streaming Providers it has Alpaca selected. It has Keys, but under "Strean Data" it says Error Connect failure.

4. In Order Manager it says Alpaca but green Connect button, says Alpaca Connect failed, when clicked. Yesterday when streaming was working that green button also failed.

5. I have Alpaca web account opened in browser, but open or closed seems to make no difference.

No doubt am missing something. Only thing can think of is have been back testing with historic a lot, does that cause an issue, need to toggle something?
0
718
Solved
27 Replies

Reply

Bookmark

Sort
Cone8
 ( 21.52% )
- ago
#1
First thing's first. If you can't connect, restart Wealth-Lab, open the Order Manager, select Alpaca, and Connect. Make this work first.

In general, you should restart WealthLab each day and refresh broker connections.
0
Darp8
- ago
#2
Will do, I did switch to Yahoo stream and then back, and back testing did find data somewhere after that. Thanks
0
Darp8
- ago
#3
Everything the same after doing that.
I have the Strategy on 3 weeks of streaming Alpaca 15 min data, which seems to work, even though rest of WL does not think it can talk to Alpaca.
0
Darp8
- ago
#4
Did not use Strategy Monitor before. Is that necessary? I am trying to use now. It recommended 5 min data for streaming, so switched to that. Everything sets up on it, except for Broker account, that is gray with no way to enter it.
0
Cone8
 ( 21.52% )
- ago
#5
Like I said you have to fix that first. Check the configuration.
The most obvious errors are:
1. Wrong API Key(s)
2. If it's a Paper Account, is "Paper Account" checked?
0
Darp8
- ago
#6
Yes, I rebooted before last post. Paper Acct is checked. I guess can remove API keys and reinsert. They were retained after reboot.

And the only data provider checked is Alpaca and it is getting 5 min data, up to date, have to think from Alpaca.

Edit: I did put in keys again in both places, no difference.
0
Cone8
 ( 21.52% )
- ago
#7
What error did you get in the Log Viewer when trying to Connect?
0
Darp8
- ago
#8
Timestamp Source Message Exception

"3/30/2023 15:05:45:117" "Alpaca" "Exception connecting to Alpaca Streaming: Unauthorized status returned for data client. Another connection may exist." "Unauthorized status returned for data client. Another connection may exist."
"3/30/2023 15:13:26:023" "Alpaca" "Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)" "One or more errors occurred. (request is not authorized) Inner Exception: request is not authorized"
"3/30/2023 15:13:26:023" "Alpaca" "Connect Failed"
"3/30/2023 15:33:36:691" "Alpaca" "Exception connecting to Alpaca Streaming: Unauthorized status returned for data client. Another connection may exist." "Unauthorized status returned for data client. Another connection may exist."
"3/30/2023 15:54:21:725" "Alpaca" "Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)" "One or more errors occurred. (request is not authorized) Inner Exception: request is not authorized"
"3/30/2023 15:54:21:725" "Alpaca" "Connect Failed"
"3/30/2023 15:54:23:734" "Alpaca" "Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)" "One or more errors occurred. (request is not authorized) Inner Exception: request is not authorized"
"3/30/2023 15:54:23:734" "Alpaca" "Connect Failed"
"3/30/2023 18:46:54:386" "Alpaca" "Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)" "One or more errors occurred. (request is not authorized) Inner Exception: request is not authorized"
"3/30/2023 18:46:54:386" "Alpaca" "Connect Failed"

I
0
Cone8
 ( 21.52% )
- ago
#9
You need to solve this - Another connection may exist.

Alpaca is refusing presumably a second connection. Restart WealthLab and try again. If that doesn't do it, find out where this other connection is and kill it. Although I've never had trouble with it, it's possible the browser is the other connection. Chat GPT offered this:

To resolve this issue, you can try the following:

Make sure that you're not running your code in multiple instances or on multiple machines at the same time using the same API key.

Check your Alpaca account to see if there are any active connections listed under the "API Management" tab. If there are, you can disconnect them to free up your API key for use in your code.

If you're still unable to connect, you can contact Alpaca support for further assistance. They may be able to provide more information about any active connections or help you troubleshoot the issue.
1
Darp8
- ago
#10
I checked task manager and saw nothing for Alpaca.
Then did have web window with Alpaca dashboard (would that cause problems?) Closed it. No improvement

Then rebooted the PC (win10)
Opened only WL8. Tried the 3 connects to Alpaca, streaming and order manager failed, historic data worked, said 900 symbols or whatever.

Message Log - Use the green Connect button to connect to a Broker. You may need to Configure it first. (it has keys in it, configured)
Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)
Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)
Connect Failed
Connect to Alpaca failed.
Connect to Alpaca failed.
0
- ago
#11
Today I installed the extension, registered the keys, but nothing works either.

1
Darp8
- ago
#12
Anyone that can get Alpaca connect today?
0
Cone8
 ( 21.52% )
- ago
#13
Yes, no problem.

1
Cone8
 ( 21.52% )
- ago
#14
I was looking at error messages when using the wrong settings...

1. If you have a Paper Account, but don't check the Paper Trading Account box, you'll get this error:
Error Connecting to AlpacaBroker: One or more errors occurred. (request is not authorized)

2. If one of the credential strings is wrong you get this...
One or more errors occurred. (Forbidden)

Furthermore, I found that if you fail to Connect to Alpaca, you will not be able to connect in the same WealthLab session even if you fix the cause (like using the correct credentials). A restart is required (not sure why).

At least we can probably conclude that your problem is other than one of the above.
0
Darp8
- ago
#15
On Paper Trading on DataManager it has paper box checked and been that way for 2 days.

On Order Manager, Paper is checked too.

What about IB, I have it, should I try it? Guess need to load the IB extension will do that now.

0
Darp8
- ago
#16
setting up IB now.
WL says: Allow conections from localhost only - to connect to TWS running on a different virtual machine or network uncheck this and enter the Trusted IP. For example, if you're using the Mac version of TWS, open your Mac's Network app and enter the IP for the wireless/cabled connection here, e.g., 192.168.1.10.

It is checked in config, but since I have only one PC for IB, should be able to leave checked?

I will switch this to new topic
0
- ago
#17
I am encountering the same Alpaca issue as someone else from an older post, I am mentioning it in case it is related to the problems people are having above.

I entered a new Alpaca account number and API key in the order manager/data manager, but when I try to add a strategy with Alpaca to the strategy monitor then an old account name/API key shows up. The new numbers autopopulate when I enter them into order or data manager, but it is not automatically changing the numbers in strategy monitor.

I was using Alpace successfully and then this issue popped up. I am using the most recent versions of Wealth-Lab and the Alpaca extension. Is there a file I can go to to manually enter in the Alpaca username/API key? Welcome any advice, many thanks!
0
Glitch8
 ( 11.82% )
- ago
#18
Hi rounderone, the Strategy Monitor doesn't show the API key anywhere, only the account numbers. Are you saying it's showing an incorrect account number for the connected API key? Note they are two different strings.
0
- ago
#19
Sorry yes sir, it is an old account number, I can't figure out a way to update that number. The new number shows up in the order and data managers but doesn't update the strategy monitor Alpaca account number. I've tried closing the program and reopening but still the same.
0
Glitch8
 ( 11.82% )
- ago
#20
What if you drag a new Strategy in? Does it still show the outdated account number?
0
- ago
#21
Yes sir, it does. I also noticed that although the "configure" dialog in the order manager shows the new account, the actual account number shown on the order manager screen is the old one. Below I tried to upload a screen shot showing the Settings page for the Strategy Monitor (old account PAxxx), the Data Manager Alpaca settings showing the new account (PKxxx) and the Order Manager account number showing the old account (PAxxx).



(I'm very sorry for the late response, I had some internet issues.)
0
Cone8
 ( 21.52% )
- ago
#22
You're confusing the API Key with the Account number. Your job is to put in the API Key and Secret Key that corresponds to your Alpaca account. And, if it's a Paper Account, you must check the "Paper Trading Account" box so that WealthLab uses the correct endpoint.

When you Connect with those credentials, your Alpaca Account number will appear wherever it's needed. You probably never have to look at the API Key again. Clear?
0
- ago
#23
Thank you, sir: I am sorry for using the wrong terminology. I will restate the issue using the correct terms. (I'm starting to sound like ChatGPT!) There is an "API Key" and a "Secret Key." I regenerated new keys - the API one starts with "PK" - and entered them into Wealth-Lab. The Data Manager and the "Configure" settings for Order Manager show the new key "PK." However, for some reason (probably operator error!), the new key ("PK") did not auto-populate to the Order and Strategy Managers. The old API Key number (starting with "PA") still shows up as the only Alpaca option when I add a new strategy, and in the Order Manager drop-down list where "PA" is the only option (the new API Key "PK" shows in "Configure" settings for Order Manager, but the old API Key "PA" shows in the header area). Pictures below:



0
Cone8
 ( 21.52% )
- ago
#24
I really can't say it any other way than I just did, but I'll try again anyway.
You're confusing the API Key with the Account Number.

Your Account number starts with PA.

Your API Key starts with PK.
The API Key and the Secret Key are the login credentials to the "PA..." Account.

Everything is working correctly!
0
Best Answer
- ago
#25
I, too, have been having problems getting ThinkorSwim (in this case) and Yahoo (as well) to stream for my strategies. I've been having this problem for three days.
0
- ago
#26
Dear Mr. Cone,

I stand corrected! I am so sorry, now I understand what you are saying! One thousand pardons!

I now see that the account number has a similar nomenclature but is different than the API key. I apologize for being so obtuse!

Armed with this new information, I was able to get the connection working again. Thank you!!!
0
Cone8
 ( 21.52% )
- ago
#27
Neverlong, this topic is on Alpaca streaming.
0

Reply

Bookmark

Sort