Exit Target
workflow.run_exit_targetCalculate the exact exit price needed to hit a target PnL or ROE percentage. Edge cases: entryPrice, leverage and sizeBase above zero; targetMode pnl or roe, targetValue any number; fees 0 to 0.05 (defaults 0.0002 and 0.0005); a target that cannot be reached from this position is an error. Not covered: funding, slippage, liquidation before the target, and the chance that price gets there. Use when user asks "at what price do I take profit to make $500?" or "where should I set TP for 20% ROE?". Returns: targetExitPrice.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"side": "<side>",
"entryPrice": "<entryPrice>",
"leverage": "<leverage>",
"sizeBase": "<sizeBase>",
"targetMode": "<targetMode>",
"targetValue": "<targetValue>"
},
"name": "workflow.run_exit_target"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Trade direction: "long" or "short" | |
| leverage | Yes | Leverage multiplier | |
| sizeBase | Yes | Position size in base asset | |
| entryPrice | Yes | Entry price | |
| feeOpenPct | No | Opening fee fraction, default 0.0002 | |
| targetMode | Yes | "pnl" = target in USDT, "roe" = target in % | |
| feeClosePct | No | Closing fee fraction, default 0.0005 | |
| targetValue | Yes | Target value (USDT/coin for pnl mode, or %) | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. For inverse, pnl-mode targetValue and outputs are in the base coin. |