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

Strategy / Reference

alerta.strategy.opentrades.profit_percent

TradingView-compatible spelling: strategy.opentrades.profit_percent, runs without warnings

Returns mark-to-market profit percent for an open trade.

alerta.strategy.opentrades.profit_percent(trade_index) → float

Parameters

NameTypeRequiredDefaultDescription
trade_indexintYes—Open trade index.

Returns

float

Example

alerta.strategy.opentrades.profit_percent
strategy("Open Profit %", overlay=true)p = strategy.opentrades > 0 ? strategy.opentrades.profit_percent(0) : 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.