Create Alert
Create a new price alert for a security. The alert fires when the specified condition is met.
SDK Links
Python | longport.openapi.AlertContext.add |
Rust | longport::alert::AlertContext#add |
Go | AlertContext.Add |
Node.js | AlertContext#add |
Parameters
SDK method parameters.
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | YES | Security symbol, e.g. TSLA.US |
| condition | AlertCondition | YES | Trigger condition: PriceRise, PriceFall, PercentRise, PercentFall |
| trigger_value | string | YES | Threshold value, e.g. "600" (price) or "5" (percentage) |
| frequency | AlertFrequency | YES | How often to trigger: Daily, EveryTime, Once |
Request Example
Response
Response Example
json
{
"code": 0,
"message": "success",
"data": {}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | Success | None |
| 400 | Bad request | None |