The average profit of the winning closed trades in the account currency.
strategy.avg_winning_trade is a series float: gross profit divided by the number of winning trades. It is na while there is no winner.
Type
series float
Remarks
- Compare it with
strategy.avg_losing_tradeto see the payoff ratio. - The formula is
strategy.grossprofitdivided bystrategy.wintrades. It leaves out the losers, so read it besidestrategy.avg_losing_tradeand the win rate.
Example
//@version=6
strategy("Payoff ratio", 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")
payoff = strategy.avg_losing_trade > 0 ? strategy.avg_winning_trade / strategy.avg_losing_trade : na
plot(payoff, "Average win / average loss", color.green)
hline(1, "Even", color.gray)See also
strategy.avg_losing_tradestrategy.avg_tradestrategy.grossprofitstrategy.wintradesstrategy.avg_winning_trade_percent
Runs on Sidechair