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

Strategy / Reference

alerta.strategy.closedtrades.exit_price

TradingView-compatible spelling: strategy.closedtrades.exit_price, runs without warnings

Returns exit price of a closed trade.

alerta.strategy.closedtrades.exit_price(trade_index) → float

Parameters

NameTypeRequiredDefaultDescription
trade_indexintYes—Closed trade index.

Returns

float

Example

alerta.strategy.closedtrades.exit_price
strategy("strategy.closedtrades.exit_price", overlay=false)if bar_index == 3    strategy.entry("Long", strategy.long, comment="Example entry")if bar_index == 8    strategy.close("Long", comment="Example exit")value = strategy.closedtrades > 0 ? strategy.closedtrades.exit_price(0) : navar result = table.new(position.top_right, 1, 1)if barstate.islast    table.cell(result, 0, 0, str.tostring(value), text_color=chart.fg_color)

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.