workflow.run_exit_target
Calculate the exact exit price needed to hit a target PnL or ROE percentage. 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| 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. |