Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.strategy.closedtrades.first_index
On this pageSignatureReturnsExample

Strategy / Reference

alerta.strategy.closedtrades.first_index

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

The trade number of the oldest closed trade the strategy keeps. No closed trade is ever dropped from the list here, so it is always 0.

alerta.strategy.closedtrades.first_index → int

Returns

int

Example

alerta.strategy.closedtrades.first_index
//@version=6strategy("Closed trades")if bar_index % 20 == 0    strategy.entry("L", strategy.long)if bar_index % 20 == 10    strategy.close("L")plot(strategy.closedtrades - strategy.closedtrades.first_index, "Listed trades")

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.