| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/noneback/openapi/main/examples/python/submit_order.py | [Back] [Original] |
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)
| Web Proxy Viewer | New URL | Original Page |