Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc05b4d

Browse files
added ws url
1 parent aa214f1 commit cc05b4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎websocket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
api_key = 'Insert_your_api_key_here'
88
api_secret = 'Insert_your_api_secret_here'
99
base_url = 'https://paper-api.alpaca.markets'
10-
10+
data_url='wss://data.alpaca.markets'
1111

1212
# instantiate REST API
1313
api = tradeapi.REST(api_key, api_secret, base_url, api_version='v2')
1414

1515

1616
# init WebSocket
1717
conn = tradeapi.stream2.StreamConn(
18-
api_key, api_secret, base_url=base_url, data_url=ws_url, data_stream='alpacadatav1'
18+
api_key, api_secret, base_url=base_url, data_url=data_url, data_stream='alpacadatav1'
1919
)
2020

2121

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /