FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi/examples/python/submit_order.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
/
submit_order.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (14 loc) · 431 Bytes
Breadcrumbs
openapi
/
examples
/
python
/
submit_order.py
Copy path
File metadata and controls
16 lines (14 loc) · 431 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
15
16
from
decimal
import
Decimal
from
longport
.
openapi
import
TradeContext
,
Config
,
OrderSide
,
OrderType
,
TimeInForceType
config
=
Config
.
from_env
()
ctx
=
TradeContext
(
config
)
resp
=
ctx
.
submit_order
(
side
=
OrderSide
.
Buy
,
symbol
=
"700.HK"
,
order_type
=
OrderType
.
LO
,
submitted_price
=
Decimal
(
50
),
submitted_quantity
=
Decimal
(
200
),
time_in_force
=
TimeInForceType
.
Day
,
remark
=
"Hello from Python SDK"
,
)
print
(
resp
)
Back
|
FazBrowse Home
|
New Git URL