You can copy paste the code or refer the screenshot.
Please make sure everything is in order as seen in the screen shot below. Copy pasting can lead to codes being crunched up so please be careful with the spaces.
Contact us at "[email protected]" if there are any questions
//@version=4
strategy(title="Donchian Channels Breakout", overlay=true)
days = 20
h1 = highest(high[1],days)
l1= lowest(low[1],days)
mid = avg(h1, l1)
plot(mid, "channel", color=#FF6D00)
u = plot(h1, "Upper", color=#2962FF)
l = plot(l1, "Lower", color=#2962FF)
fill(u, l, color=color.blue)
if close>h1
strategy.entry("long",strategy.long)
l2= lowest(low[1],days*2)
if close<l2
strategy.close("long")