The largest trough-to-peak rise in equity so far, as a percent of the equity low.
strategy.max_runup_percent is a series float: the biggest percentage climb from an equity low to the following high. It only grows.
Type
series float
Remarks
- It is measured against the low the climb started from.
- Equity rising from 8,000 to 10,000 is a run-up of 25 percent, since the base is the 8,000 low; equity falling from 10,000 to 8,000 is a drawdown of 20 percent, since the base is the 10,000 peak.
Example
//@version=6
strategy("Run-up to drawdown 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")
ratio = strategy.max_drawdown_percent > 0 ? strategy.max_runup_percent / strategy.max_drawdown_percent : na
plot(ratio, "Run-up / drawdown", color.blue)
hline(1, "Even", color.gray)See also
strategy.max_runupstrategy.max_drawdown_percentstrategy.equitystrategy.openprofit_percentstrategy.netprofit_percent
Runs on Sidechair