Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

03 — Trailing stop sell

Place a trailing-stop sell that locks in gains as price climbs but exits if it drops back by a percentage.

What it does

You hold X% of your BONK position. You set a 10% trailing stop. As BONK rises, the stop trails 10% below the high-water mark. If BONK drops 10% from its peak, the stop fires and the agent sells.

Agent calls place_trailing_order once. The MCP server registers the order with api.traderouter.ai, monitors the price server-side (~5s polling), and sends an unsigned exit tx over the WS the moment the trail fires. The agent signs locally and submits.

Run it

cp .env.example .env
export TRADEROUTER_DRY_RUN=true
node agent.mjs

When to use this pattern

  • You bought into a position and want to ride the trend
  • You don't want to babysit the chart
  • You're comfortable with the trail % representing your max acceptable drawdown from peak

When to use something else

  • You want to exit at a specific price target → use a place_limit_order with action 'sell'
  • You want to take profit gradually as you climb → use 05-combo-take-profit