FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi/examples/python/subscribe_quote.py at main · noneback/openapi · GitHub
noneback
/
openapi
Public
forked from
longbridge/openapi
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openapi
/
examples
/
python
/
subscribe_quote.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (10 loc) · 379 Bytes
Breadcrumbs
openapi
/
examples
/
python
/
subscribe_quote.py
Copy path
File metadata and controls
14 lines (10 loc) · 379 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from
time
import
sleep
from
longport
.
openapi
import
QuoteContext
,
Config
,
SubType
,
PushQuote
,
Period
,
AdjustType
def
on_quote
(
symbol
:
str
,
event
:
PushQuote
):
print
(
symbol
,
event
)
config
=
Config
.
from_env
()
ctx
=
QuoteContext
(
config
)
ctx
.
set_on_quote
(
on_quote
)
ctx
.
subscribe
(
[
"700.HK"
,
"AAPL.US"
,
"TSLA.US"
,
"NFLX.US"
], [
SubType
.
Quote
],
is_first_push
=
True
)
sleep
(
10
)
Back
|
FazBrowse Home
|
New Git URL