-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Summary
When submitting US options orders via the Python SDK, the outside_rth parameter is silently overridden to OutsideRTH.RTHOnly regardless of the value passed (AnyTime or Overnight). No error is returned — the order is accepted but the session type is changed server-side.
Context
Longbridge launched pre-market US options trading on Jan 22, 2026, supporting tickers including AMZN, AAPL, SPY, QQQ, etc. We are trying to place pre-market option orders via the OpenAPI SDK.
Steps to Reproduce
from decimal import Decimal
from longport.openapi import (
TradeContext, Config, OrderSide, OrderType,
TimeInForceType, OutsideRTH
)
ctx = TradeContext(Config.from_env())
# Attempt 1: AnyTime
resp = ctx.submit_order(
symbol="AMZN260320P190000.US",
order_type=OrderType.LO,
side=OrderSide.Sell,
submitted_quantity=Decimal(1),
submitted_price=Decimal("1.37"),
time_in_force=TimeInForceType.Day,
outside_rth=OutsideRTH.AnyTime, # <-- passed AnyTime
)
detail = ctx.order_detail(resp.order_id)
print(detail.outside_rth) # OutsideRTH.RTHOnly <-- server overrode to RTHOnly
# Attempt 2: Overnight
resp2 = ctx.submit_order(
symbol="AMZN260320P190000.US",
order_type=OrderType.LO,
side=OrderSide.Sell,
submitted_quantity=Decimal(1),
submitted_price=Decimal("2.50"),
time_in_force=TimeInForceType.Day,
outside_rth=OutsideRTH.Overnight, # <-- passed Overnight
)
detail2 = ctx.order_detail(resp2.order_id)
print(detail2.outside_rth) # OutsideRTH.RTHOnly <-- also overriddenExpected Behavior
The order should retain the outside_rth value passed in the request (either AnyTime or Overnight), allowing the order to be eligible for pre-market options trading (4:00 AM – 9:30 AM ET).
If the value is not supported for options, the API should return an error rather than silently overriding it.
Actual Behavior
OutsideRTH.AnyTime→ silently changed toOutsideRTH.RTHOnlyOutsideRTH.Overnight→ silently changed toOutsideRTH.RTHOnly- No error returned, order accepted with 200 OK
Questions
- Which
OutsideRTHvalue should be used for pre-market US options orders? - Is there an account-level permission that needs to be enabled for pre-market options via API?
- Is pre-market options trading supported through the OpenAPI at all, or only via the app UI?
Environment
- Python SDK:
longport(latest pip version) - Platform: Docker (Python 3.12, Linux x86_64)
- Account region: Hong Kong