cankardesler stoploss v2
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © efedoracankardes

//@version=5
indicator("cankardesler stoploss v2", overlay=true)
ys = high-open

as0 =  close - low


ts = close - (2*ta.atr(14))
tsry = ((ts-(ta.stdev(as0,5))))
tsye = math.min(ts,tsry)
plot(tsye, color=color.red)

ts2 = close + (2*ta.atr(14))
tsra = ((ts2+(ta.stdev(ys,5))))
tsae = math.max(ts2,tsra)
plot(tsae, color=color.green)