Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.strategy.position_avg_price
On this pageSignatureReturnsExampleNotes

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 float

Returns

series float

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.