Strategy / Reference
alerta.strategy.position_avg_price
TradingView-compatible spelling: strategy.position_avg_price, runs without warnings
Average entry price of the currently open simulated strategy position. The value follows fills in the strategy simulator. While the strategy has no position it is na, as in Pine.
alerta.strategy.position_avg_price → series floatReturns
series floatExample
alerta.strategy.position_avg_price
//@version=6strategy("Average entry")if bar_index == 10 strategy.entry("Long", strategy.long)plot(strategy.position_size != 0 ? strategy.position_avg_price : na)Notes
- Use inside a strategy() script. This is a simulation value, not an exchange account balance or execution price.
Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.