Strategy / Reference
alerta.strategy.closedtrades.profit_percent
TradingView-compatible spelling: strategy.closedtrades.profit_percent, runs without warnings
Returns realized profit percent for a closed trade.
alerta.strategy.closedtrades.profit_percent(trade_index) → floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
trade_index | int | Yes | — | Closed trade index. |
Returns
floatExample
alerta.strategy.closedtrades.profit_percent
strategy("Closed Profit %", overlay=true)p = strategy.closedtrades > 0 ? strategy.closedtrades.profit_percent(strategy.closedtrades - 1) : 0plot(p, { pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.