mrtools.....could this concept of an RSI Support and Demand Level (from Trading View) converted into an MT4 Indicator....
Draws supply and demand zones based on the RSI indicator. For example if RSI is under 30 a supply zone is drawn on the chart and extended for as long as there isn't a new crossunder 30. Same goes for above 70.
https://www.tradingview.com/script/m6dD ... nd-Demand/
//@version=3
study(title="Supply/Demand", shorttitle="SD",overlay=true)
src = close, len = input(14, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
tresh = input(30,minval=1,title="Treshold eg. 100 - 30 = 70")
uppertreshold = 100 - tresh
lowertreshold = 0 + tresh
count = input(3,title="Confirmation Bars")
rsu = 0
rsd = 0
rsx = 0
incrementer_up = rsi > uppertreshold ? 1 : 0
incrementer_down = rsi < lowertreshold ? 1 : 0
incrementer_both = rsi > uppertreshold or rsi < lowertreshold ? 1 : 0
if incrementer_both
rsx := nz(rsx[1],0) + incrementer_both
else
rsx = 0
rxH = if (rsx >= count)
x = high
rxL = if (rsx >= count)
y = low
rH = fixnan(rxH)
rL = fixnan(rxL)
if incrementer_up
rsu := nz(rsu[1],0) + incrementer_up
else
rsu = 0
rssH = if (rsu >= count)
x = high
rssL = if (rsu >= count)
y = low
if incrementer_down
rsd := nz(rsd[1],0) + incrementer_down
else
rsd = 0
rsrH = if (rsd >= count)
x = high
rsrL = if (rsd >= count)
y = low
rsh = fixnan(rssH)
rsl = fixnan(rssL)
rrh = fixnan(rsrH)
rrl = fixnan(rsrL)
p1 = plot(rsh,style=cross,title="Resistance Zone High",transp=100)
p2 = plot(rsl,style=cross,title="Resistance Zone High",transp=100)
p3 = plot(rrh,style=cross,title="Support Zone High",transp=100)
p4 = plot(rrl,style=cross,title="Support Zone Low",transp=100)
p5 = plot(rH,style=cross,title="Demand Below / Supply Above | High")
p6 = plot(rL,style=cross,title="Demand Below / Supply Above | Low")
fill(p1,p2,color=green,transp=100)
fill(p3,p4,color=green,transp=100)
fill(p5,p6,color=blue)