Noro's Channel Close Strategy
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © noro

//@version=4
strategy(title = "noro's Channel Close Strategy", shorttitle = "Channel Close str", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0, commission_value = 0.1)
len = input(10)
h = highest(high, len)
l = lowest(low, len)
plot(h)
plot(l)

if close > h[1]
    strategy.entry("Long", strategy.long)

if close < l[1]
    strategy.entry("Short", strategy.short)