Wick Pressure/Close point inside the bar
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © venkatadora


//@version=5
indicator("wickpressure")

//Period
per  = input(defval=21, title="Period")


buypressure = (close/low)
sellpressure = (high/close)

wickscr = (buypressure/sellpressure)

Escore =  ta.hma (wickscr,per)/ta.stdev(wickscr,per)

emaEscore = ta.hma(Escore,50)



//Colors
dcolor = Escore > emaEscore ? color.green : Escore < emaEscore ? color(color.maroon) : color(color.black)
fcolor = Escore > 0 ? color(color.green) :Escore < 0 ? color(color.maroon) : color(color.black)

plot(Escore,color=dcolor,linewidth= 3, title ="D3score", style = plot.style_area)
plot(emaEscore, color= (color.yellow),linewidth=4,title ="emaEscore",style = plot.style_line)

