Analyze one caller-supplied combo: max profit/loss
POST/api/v1.0/quote/option-strategy-analysisAnalyze one caller-supplied combo: max profit/loss, break-even points, probability of profit, premium, days to expiry, underlying price. Leg shape matches quote.combo_option_quote combo_list[].legs (code / side / quantity); this API analyzes one combo, so combo_list max is 1. Covered / Collar / Customize may include one stock leg to specify side and quantity; the stock must be the option underlying. strategy defaults to Customize=100. P&L curves are not returned. Use quote.combo_option_quote for combo bid/ask. Combo Delta/Theta are not returned. Unlimited maximum profit or loss is returned as null. Realtime quote; login and realtime permission required.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
combo_list | string | body | yes | Combo list, max 1 combo. Legs in legs[]; at least one option contract. Covered/Collar/Customize may add one underlying stock. |
strategy | int | body | no | Strategy type. 1=SingleOption 2=CoveredCall 3=ProtectivePut 4=SpreadCall 5=SpreadPut 6=Straddle 7=Strangle 8=Collar 9=ButterflyCall 10=ButterflyPut 11=CondorCall 12=CondorPut 13=IronButterfly 14=IronCondor 15=CalendarSpread 16=DiagonalSpread 100=Customize. Defaults to 100 |
Example
bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/quote/option-strategy-analysis' -H 'Content-Type: application/json' -d '{}' \
-H 'Authorization: Bearer <AccessToken>' | jqResponse parameters
| Name | Type | Description |
|---|---|---|
data.legs | string | Echoed request legs (code / side / quantity) |
data.strategy | int | Strategy type used for analysis; 100 when omitted |
data.break_even_points | number | Break-even points (already /1e9) |
data.max_profit | number | Max profit (already /1e9); null when unlimited |
data.max_loss | number | Max loss magnitude (already /1e9); null when unlimited |
data.profit_probability | number | Probability of profit (0~1, already /1e9) |
data.underlying_price | string | Underlying price (already /1e9) |
data.premium | string | Combo option premium (already /1e9); may be omitted for custom combo price or stock-inclusive strategies |
data.days_to_expiry | int | Days remaining to expiry |
Errors
| ret_code | error.code | Description |
|---|---|---|
| 0 | — | Success |
| -3 | invalid_parameter | Missing or invalid parameter |
| -8 | unsupported | Not supported |
| -10 | no_data | No data |
Response example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"legs": "example",
"strategy": 0,
"break_even_points": 1.2,
"max_profit": 1.2,
"max_loss": 1.2,
"profit_probability": 1.2,
"underlying_price": "example",
"premium": "example",
"days_to_expiry": 0
}
}