Trailing limit command
What it does
Section titled “What it does”trailingLimit tracks price movement and manages a working limit order using a minimum and maximum offset range.
This is more advanced than market or limit.
Use TradingView Order Syntax first if you need the full command structure before working through individual command types.
Typical fields
Section titled “Typical fields”type=trailingLimitamount=...position=...minOffset=...maxOffset=...reduceOnly=truepostOnly=truebackground=trueorfalsetimeLimit=...slippageLimit=...onLimitAction=...
Typical exit example
Section titled “Typical exit example”ALPHA(BTCUSDT){ type=trailingLimit, position=0, minOffset=0.20%, maxOffset=0.40%, reduceOnly=true, background=false}Background mode
Section titled “Background mode”If background=true, the trailing process keeps running in the background after the command starts.
If background=false, the execution stays in the foreground.
Typical use case
Section titled “Typical use case”Use trailingLimit when you want:
- a dynamic working exit
- a moving passive order
- a more controlled follow-up than a plain fixed limit
Practical advice
Section titled “Practical advice”Do not use trailingLimit as your first command type.
Start with:
marketlimit
Then move to trailingLimit after you already trust your payload flow and Console verification process.
Common mistakes
Section titled “Common mistakes”Invalid offset range
Section titled “Invalid offset range”If the offset values cannot resolve cleanly, the command may fail or be skipped.
Starting with a complex trailing workflow too early
Section titled “Starting with a complex trailing workflow too early”Get the basics working first, then add trailing logic.
Not checking background behavior
Section titled “Not checking background behavior”Always verify in Console whether the trailing process is running in background or foreground.