MarcoValente

HH&LL (Highest High and Lowest Low)

428 5 30
It show us HH and LL, OB             line and OS can regulate as you like ; histogram is the difference between the hh and ll, and show the strenght of the trend. Can use also the adaptive bands for the OB/OS level.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("HH&LL") // highest high & lowest low
length=input(20)
ww=input(false,title="use adaptive OS/OB ?")
qq=input(true,title="use backround signal color?")
his=input(true,title="Show Histogram?")
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? (Uncheck Box Above).", type=resolution, defval="D")
res = useCurrentRes ? period : resCustom
HHH =iff( high > high[1], (high - lowest( high, length )) /( highest( high, length ) - lowest( high, length ) ), 0 ) 
LLL = iff( low < low[1],( highest( low, length ) - low ) /( highest( low, length ) - lowest( low, length ) ), 0 ) 
HHSa = ema( HHH, length ) * 100 
LLSa = ema( LLL, length ) * 100 
HHS = security(tickerid, res,HHSa)
LLS= security(tickerid, res, LLSa)
aa=plot( HHS, "HHS" ,color=blue,transp=0) 
bb=plot( LLS, "LLS" ,color=red,transp=0) 	
hln=input(60)
lln=input(10)
smo=input(50,"Bands Filter length")
hs=highest(max(HHS,LLS),50)
lw=lowest(min(LLS,HHS),50)
mh=ema(hs,20)
RMSa= sum( mh*mh, smo)
RMS= avg(sqrt(RMSa/smo),hln)
al=ww?RMS:hln
ms=ema(lw,20)
MSa= sum( ms*ms, smo)
MS= avg(sqrt(MSa/smo),lln)
bs=ww?MS:lln
col=HHS>al and HHS[2]<HHS[1] and HHS[1]>HHS and LLS<bs?1:0
cor=LLS>al and LLS[2]<LLS[1] and LLS[1]>LLS and HHS<bs?1:0
con=HHS<bs and HHS[2]>HHS[1] and HHS[1]<HHS and LLS>al?1:0
cod=LLS<bs and LLS[2]>LLS[1] and LLS[1]<LLS and HHS>al?1:0
bc=col or cod?red: cor or con?green:na
a=plot(al,style=cross,color=black,transp=50)
b=plot(bs,style=cross,color=black,transp=50)
df=abs(HHS-LLS)
cl=df>55?red : df<25?green :orange
plot(his?df:na,color=cl,style=histogram,linewidth=2,transp=75)
plot(HHS>al?HHS:na,style=histogram,histbase=60,color=red)
plot(LLS>al?LLS:na,style=histogram,histbase=60,color=red)
plot(LLS<bs?LLS:na,style=histogram,histbase=10,color=green)
plot(HHS<bs?HHS:na,style=histogram,histbase=10,color=green)
bgcolor(qq?bc:na,transp=80)
cdmax
6 months ago
looks good, can anybody tell me how to add this indicator to my MT4? thanks
Reply
MarcoValente cdmax
6 months ago
http://traders.com/Documentation/FEEDbk_docs/2016/02/TradersTips.html
Try here , there is the code for many different plattaform, but I m not sure about MT4
Reply
cdmax MarcoValente
6 months ago
let me find it out, thanks!
Reply
coondawg71 PRO
6 months ago
Nice work, thanks for sharing!
Reply
JuanR PRO
6 months ago
Muchas gracias!! . Muy bueno
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out