ib_trailing_stop
Manage Interactive Brokers trailing stop orders for stocks and naked LEAPS positions; dry-run previews order changes before execution.
Instructions
Manage IB native TRAIL orders for stocks and naked LEAPS positions.
Default mode is dry-run — no orders are placed unless execute=True. PMCC positions are excluded; use ib_stop_loss for those. Requires TWS or IB Gateway running locally.
Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional) symbols: Comma-separated symbols to filter (optional, e.g. 'JOBY,TSLA') trail_pct: Trail amount as % of reference price (default 20, mutually exclusive with trail_amt) trail_amt: Trail amount in dollars (mutually exclusive with trail_pct) price_mode: Option pricing — 'mid' (bid+ask)/2 or 'last' (LEAPS only) execute: Cancel orphan TS_ orders and place new TRAIL orders (default False = dry-run) forced: Cancel and replace existing TS_ orders with current parameters (requires execute=True)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | ||
| forced | No | ||
| account | No | ||
| execute | No | ||
| symbols | No | ||
| trail_amt | No | ||
| trail_pct | No | ||
| price_mode | No | mid |