Sidechair

strategy.avg_winning_trade_percent

Browse the reference

The average percentage gain of the winning closed trades.

Try it in the editor

strategy.avg_winning_trade_percent is a series float: the mean percentage result of the trades that closed with a profit. It is na while there is no winner.

Type

series float

Remarks

Example

Pine ScriptAverage winner against average loserOpen in editor
//@version=6
strategy("Winner and loser size", 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.avg_winning_trade_percent, "Average winner %", color.green)
plot(-strategy.avg_losing_trade_percent, "Average loser % (negative)", color.red)

See also

Runs on Sidechair