I Want to Execute Complex Orders
Is this you?
- You want to use limit orders, stop orders, trailing stops, or combo orders (e.g. market + stop-loss + take-profit)
- You're not sure which alert format or fields to use
- You want to understand how price rounding works
Quick Answer
✅ XeroLite supports:
- Market orders — Fill at best available price.
- Limit orders — Fill at a specific price or better.
- Stop orders — Trigger when price reaches a level (e.g. stop-loss).
- Trailing stop — Stop that trails price (v1.2+).
- Combo orders — Main order + stop-loss and/or take-profit in one alert.
Use the alert request format (v1.1 or v1.2) and set order_type and the right fields (e.g. price, sl_offset, tp_offset, trail_amt).
Setup (high level)
- Choose order type — e.g.
MARKET,LIMIT,STOP,TRAIL. - Set fields in your alert JSON — e.g.
pricefor limit,sl_offset/tp_offsetfor stop-loss/take-profit,trail_amtfor trailing stop. - Use Alert Request Builder — Build a valid message and copy it into TradingView.
- Test with paper trading — Verify order execution and rounding before going live.
Order Types and Examples
| Type | Use case | Key fields |
|---|---|---|
| Market | Execute immediately at best price | order_type: "MARKET" |
| Limit | Buy/sell at specific price or better | order_type: "LIMIT", price |
| Stop | Stop-loss or breakout | order_type: "STOP", price (stop price) |
| Trailing stop | Lock in profit as price moves | order_type: "TRAIL", trail_amt (v1.2+) |
| Combo | Main order + SL/TP | Main order + sl_offset / tp_offset (or separate legs) |
Price rounding is applied automatically to match IB rules.
See Also
- Combo Order Types — Parent/child orders, stop-loss, take-profit, trailing stop
- Price Rounding Rules — How rounding works
- Alert Request Format v1.2 — All fields and order types
- Alert Request Builder — Build and test alert messages
- Troubleshooting — Order execution errors