Strategy / Reference
alerta.strategy.netprofit
TradingView-compatible spelling: strategy.netprofit, runs without warnings
Cumulative realized profit and loss from closed simulated strategy trades. It does not include the unrealized profit of the currently open position.
alerta.strategy.netprofit → series floatReturns
series floatExample
alerta.strategy.netprofit
//@version=6strategy("Realized profit", overlay = false)if bar_index == 10 strategy.entry("Long", strategy.long)if bar_index == 20 strategy.close("Long")plot(strategy.netprofit)Notes
- Use inside a strategy() script. Strategy results depend on the available bars and the simulator’s fill and cost settings.
Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.