期權交易
期權 API 使用與股票相同的統一訂單端點。通過設置 instrument_type: OPTION 並提供包含期權特定參數的 legs 陣列來區分。
支援的訂單類型
期權支援以下訂單類型:
| 訂單類型 | 說明 |
|---|---|
LIMIT | 以指定價格或更優價格執行 |
STOP_LOSS | 當觸及止損價時觸發市價單 |
STOP_LOSS_LIMIT | 當觸及止損價時觸發限價單 |
警告
期權不支援 MARKET 訂單類型。僅支援 BUY 和 SELL 方向(不支援 SHORT)。
賣方訂單的有效期限制
期權賣方訂單(SELL)的 time_in_force 僅支援 DAY。GTC 僅適用於買方訂單。
有效期
| 值 | 說明 |
|---|---|
DAY | 僅當日有效 |
GTC | 撤銷前有效 |
關鍵參數
| 參數 | 必填 | 說明 |
|---|---|---|
option_strategy | 是 | SINGLE 表示單腿訂單 |
legs | 是 | 腿定義陣列 |
legs[].symbol | 是 | 標的代碼(如 AAPL) |
legs[].strike_price | 是 | 期權行權價 |
legs[].option_expire_date | 是 | 到期日,格式 YYYY-MM-DD |
legs[].instrument_type | 是 | OPTION |
legs[].option_type | 是 | CALL 或 PUT |
legs[].market | 是 | US |
legs[].side | 是 | BUY 或 SELL |
legs[].quantity | 是 | 合約數量 |
API 端點
期權使用與股票訂單相同的端點。完整列表請參閱API 端點。
請求範例
- 買入看漲(限價)
- 買入看跌(限價)
- 賣出看漲(限價)
- 賣出看跌(限價)
- 止損單
- 止損限價單
以 $11.25 的限價買入 1 張 AAPL 看漲期權,行權價 $220,到期日 2025-11-19。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "LIMIT",
"limit_price": "11.25",
"quantity": "1",
"option_strategy": "SINGLE",
"side": "BUY",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "AAPL",
"legs": [
{
"side": "BUY",
"quantity": "1",
"symbol": "AAPL",
"strike_price": "220.00",
"option_expire_date": "2025-11-19",
"instrument_type": "OPTION",
"option_type": "CALL",
"market": "US"
}
]
}
]
}
以 $8.50 的限價買入 2 張 TSLA 看跌期權,行權價 $250,到期日 2025-12-19。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "LIMIT",
"limit_price": "8.50",
"quantity": "2",
"option_strategy": "SINGLE",
"side": "BUY",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "TSLA",
"legs": [
{
"side": "BUY",
"quantity": "2",
"symbol": "TSLA",
"strike_price": "250.00",
"option_expire_date": "2025-12-19",
"instrument_type": "OPTION",
"option_type": "PUT",
"market": "US"
}
]
}
]
}
以 $5.00 的限價賣出 1 張 AAPL 看漲期權(備兌看漲),行權價 $230,到期日 2025-11-19。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "LIMIT",
"limit_price": "5.00",
"quantity": "1",
"option_strategy": "SINGLE",
"side": "SELL",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "AAPL",
"legs": [
{
"side": "SELL",
"quantity": "1",
"symbol": "AAPL",
"strike_price": "230.00",
"option_expire_date": "2025-11-19",
"instrument_type": "OPTION",
"option_type": "CALL",
"market": "US"
}
]
}
]
}
以 $6.00 的限價賣出 1 張 NVDA 看跌期權(現金擔保看跌),行權價 $100,到期日 2025-12-19。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "LIMIT",
"limit_price": "6.00",
"quantity": "1",
"option_strategy": "SINGLE",
"side": "SELL",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "NVDA",
"legs": [
{
"side": "SELL",
"quantity": "1",
"symbol": "NVDA",
"strike_price": "100.00",
"option_expire_date": "2025-12-19",
"instrument_type": "OPTION",
"option_type": "PUT",
"market": "US"
}
]
}
]
}
當期權價格跌至 $3.00 時賣出 1 張 AAPL 看漲期權(觸發市價單)。適用於保護現有的多頭期權持倉。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "STOP_LOSS",
"stop_price": "3.00",
"quantity": "1",
"option_strategy": "SINGLE",
"side": "SELL",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "AAPL",
"legs": [
{
"side": "SELL",
"quantity": "1",
"symbol": "AAPL",
"strike_price": "220.00",
"option_expire_date": "2025-11-19",
"instrument_type": "OPTION",
"option_type": "CALL",
"market": "US"
}
]
}
]
}
當 TSLA 看跌期權價格跌至 $4.00(止損價)時觸發,以 $3.80 的限價賣出 1 張。
{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"order_type": "STOP_LOSS_LIMIT",
"stop_price": "4.00",
"limit_price": "3.80",
"quantity": "1",
"option_strategy": "SINGLE",
"side": "SELL",
"time_in_force": "DAY",
"entrust_type": "QTY",
"instrument_type": "OPTION",
"market": "US",
"symbol": "TSLA",
"legs": [
{
"side": "SELL",
"quantity": "1",
"symbol": "TSLA",
"strike_price": "250.00",
"option_expire_date": "2025-12-19",
"instrument_type": "OPTION",
"option_type": "PUT",
"market": "US"
}
]
}
]
}
下一步
- 股票交易 — 股票和 ETF 訂單管理
- Trading API 概覽 — 各市場完整功能矩陣
- 帳戶 — 查詢餘額和持倉
- Trading API 常見問題 — 常見問題和故障排除