Sidechair

strategy.grossloss_percent

Browse the reference

The gross loss of all losing closed trades as a percent of the initial capital.

Try it in the editor

strategy.grossloss_percent is a series float equal to strategy.grossloss divided by strategy.initial_capital, times 100, as a positive number.

Type

series float

Remarks

Example

Pine ScriptLosses against gains as a share of capitalOpen in editor
//@version=6
strategy("Loss and gain share", initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
if ta.crossover(ta.sma(close, 10), ta.sma(close, 30))
    strategy.entry("Long", strategy.long)
if ta.crossunder(ta.sma(close, 10), ta.sma(close, 30))
    strategy.close("Long")
plot(strategy.grossprofit_percent, "Gross profit %", color.green)
plot(-strategy.grossloss_percent, "Gross loss % (negative)", color.red)

See also

Runs on Sidechair