Strategy / Reference
alerta.strategy.opentrades.entry_id
TradingView-compatible spelling: strategy.opentrades.entry_id, runs without warnings
Returns entry id of an open trade.
alerta.strategy.opentrades.entry_id(trade_index) → stringParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
trade_index | int | Yes | — | Open trade index. |
Returns
stringExample
alerta.strategy.opentrades.entry_id
strategy("strategy.opentrades.entry_id", overlay=false)if bar_index == 3 strategy.entry("Long", strategy.long, comment="Example entry")value = strategy.opentrades > 0 ? strategy.opentrades.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.