trading.kay27

Kay_High_Low

Previous High low plotting.
COPIED from Chris Moody's script and adjusted it for my needs.

Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
//Created by ChrisMoody 7-21-2014
//Daily, Weekly, Monthly, Quarterly, Yearly Projected Highs and Lows 
//Obtained formula from Larry Williams, original formula from Owen Taylor
//Modified by trading.kay for lower time frames
study(title="Kay_High_Low", shorttitle="Kay_H_L", overlay=true) 

s5m = input(false, title="5Min HL?")
s15m = input(true, title="15Min HL?")
sh = input(true, title="Hourly HL?")
s4h = input(false, title="4H HL?")
sd = input(false, title="Daily HL?")
sw = input(false, title="Weekly HL?")
sm = input(false, title="Monthly HL?")

//getData(res) =>
//	pf = (hlc3) * 2
//	pl = pf - high
//	ph = pf - low
//	f = security(tickerid, res, pf[1])
//	h = security(tickerid, res, ph[1])
//	l = security(tickerid, res, pl[1])
//	[f, h, l]

getData(res) =>
    h = security(tickerid, res, high[1])
	l = security(tickerid, res, low[1])
	[h,l]

//-------------------5 Min
[h5, l5] = getData("5")
cl5 = close > l5 or close < h5 ? blue : red

plot(s5m ? l5 : na, title="5M Proj Low",style=circles, color=cl5 ,linewidth=3) 
plot(s5m ? h5 : na, title="5M Proj High",style=circles, color=cl5 ,linewidth=3) 

//-------------------15 mins
[h15, l15] = getData("15")
cl15 = close > l15 or close < h15 ? orange : red

plot(s15m ? l15 : na, title="15M Proj Low",style=circles, color=cl15 ,linewidth=2, transp=0) 
plot(s15m ? h15 : na, title="15M Proj High",style=circles, color=cl15 ,linewidth=2, transp=0) 

//-------------------Hourly
[hh, lh] = getData("60")
clh = close > lh or close < hh ? blue : red

plot(sh ? lh : na, title="H Proj Low",style=circles, color=clh ,linewidth=2, transp=0) 
plot(sh ? hh : na, title="H Proj High",style=circles, color=clh ,linewidth=2, transp=0) 

//--------------------4Hr
[h4h, l4h] = getData("240")
cl4h = close > l4h or close < h4h ? green : red

plot(s4h ? l4h : na, title="4H Proj Low",style=circles, color=cl4h ,linewidth=1) 
plot(s4h ? h4h : na, title="4H Proj High",style=circles, color=cl4h ,linewidth=1) 

//--------------------Daily
[hd, ld] = getData("D")
cld = close > ld or close < hd ? blue : red

plot(sd ? ld : na, title="D Proj Low",style=circles, color=cld ,linewidth=3) 
plot(sd ? hd : na, title="D Proj High",style=circles, color=cld ,linewidth=3)