Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.strategy.closedtrades.profit_percent
On this pageSignatureParametersReturnsExample

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) → float

Parameters

NameTypeRequiredDefaultDescription
trade_indexintYes—Closed trade index.

Returns

float

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.