The average result of a closed trade as a percent of the trade's entry value.
strategy.avg_trade_percent is a series float: the mean of every closed trade's percentage result. It is na until the first trade closes.
Type
series float
Remarks
- Each trade's percentage uses its own entry value, so large and small trades count equally.
- A strategy can have a positive value here and a negative
strategy.avg_tradeif small trades win and large ones lose, because each trade counts once in this average.
Example
//@version=6
strategy("Average percent per trade", 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_trade_percent, "Average trade %", color.blue)
hline(0, "Zero", color.gray)See also
strategy.avg_tradestrategy.avg_winning_trade_percentstrategy.avg_losing_trade_percentstrategy.closedtrades.profit_percentstrategy.netprofit_percent
Runs on Sidechair