Strategy / Reference
alerta.strategy.opentrades.entry_price
TradingView-compatible spelling: strategy.opentrades.entry_price, runs without warnings
Returns the entry price for the specified open trade.
alerta.strategy.opentrades.entry_price(trade_index) → floatParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
trade_index | int | Yes | — | The index of the open trade (0 is oldest). |
Returns
floatExample
alerta.strategy.opentrades.entry_price
strategy("strategy.opentrades.entry_price", overlay=false)if bar_index == 3 strategy.entry("Long", strategy.long, comment="Example entry")value = strategy.opentrades > 0 ? strategy.opentrades.entry_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.