Williams % + SMA
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/


//@version=5
indicator(title="Williams % + SMA",overlay=true)
lwpr=input(14,"Период Williams %")
lsma=input(30,"Период SMA")
wpr=ta.wpr(lwpr)
ssma=ta.sma(close,lsma)
cr=ta.crossover(wpr,(-80))
cr1=ta.crossunder(wpr,(-20))
plotshape(cr and close<ssma ? low-(close/20) : 0,style=shape.arrowup,location=location.belowbar,color=color.green,text='BUY',size=size.small)
plotshape(cr1 and close>ssma ? low+(close/20) : 0,style=shape.arrowdown,location=location.abovebar,color=color.red,text='SELL',size=size.small)
