Skip to content

outside_rth parameter silently overridden to RTHOnly for US options orders #443

@py77

Description

@py77

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 overridden

Expected 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 to OutsideRTH.RTHOnly
  • OutsideRTH.Overnight → silently changed to OutsideRTH.RTHOnly
  • No error returned, order accepted with 200 OK

Questions

  1. Which OutsideRTH value should be used for pre-market US options orders?
  2. Is there an account-level permission that needs to be enabled for pre-market options via API?
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions