Chandelier Exit

Chandelier Stop /Exit - Charles LeBeau, as referenced by A. Elder
(written for up trend stop/exits only)
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
study(title="Chandelier", shorttitle="Chandelier", overlay=true)
length1 = input(14, minval=1)
length = input(22, minval=1)
ATR = rma(tr, length1) 
Coef = input(3, minval=1)
HP(length) => highest(length)

plot(HP(length)-(ATR*Coef), color=red, title="Chandelier")