Variables
strategy.openprofit
The current, unrealised profit of the open position; a loss is negative.
Example
//@lipi=2
strategy("strategy.openprofit Example", overlay=false, initial_capital=10000)
if talib.crossover(close, talib.sma(close, 20)) {
strategy.entry("Long", strategy.long)
}
if talib.crossunder(close, talib.sma(close, 20)) {
strategy.close("Long")
}
plot(strategy.openprofit, title="Openprofit", color=color.blue)
Type
series float