Donchian Strat EXMO
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © pskoroplas

//@version=4
strategy("Donchian Strat EXMO", overlay=true)

long_per = input(defval = 20, title = "Long Period")
h = highest(high, long_per)
l = lowest(low, long_per)


plot(l)
plot(h)

perc = close/100

if h[1] < h[2]
    strategy.order("BUY", true, stop = h)
    //strategy.exit("BUY", profit = 400)

if l[1] > l[2]
    strategy.order("SELL", false, stop = l)
    //strategy.exit("SELL", profit = 400)

