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 → intReturns
intExample
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.