Sidechair

strategy.max_runup

Browse the reference

The largest trough-to-peak rise in equity so far, in the account currency.

Try it in the editor

strategy.max_runup is a series float: the biggest climb from an equity low to the following high since the first bar, in money. It only grows.

Type

series float

Remarks

Example

Pine ScriptRun-up against drawdownOpen in editor
//@version=6
strategy("Run-up and drawdown", 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.max_runup, "Max run-up", color.green, style = plot.style_stepline)
plot(strategy.max_drawdown, "Max drawdown", color.red, style = plot.style_stepline)

See also

Runs on Sidechair