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

Strategy / Reference

alerta.strategy.closedtrades.entry_id

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

Returns entry id of a closed trade.

alerta.strategy.closedtrades.entry_id(trade_index) → string

Parameters

NameTypeRequiredDefaultDescription
trade_indexintYes—Closed trade index.

Returns

string

Example

alerta.strategy.closedtrades.entry_id
strategy("strategy.closedtrades.entry_id", 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.entry_id(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.