Scripts Mhi, Mh1, Mh2 Telegram @comunidadgratis

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

instrument {overlay = true,

name = 'MH',
short_name = 'MHIM1',
icon="indicators:ADX"}

exibir_doji = input (1, "Exibir No realizado por Doji?", input.string_selection,


{"SI","NO"} )
tipo_mhi = input (1, "cual tipo de MHI utilizar", input.integer, 1, 3, 1) - 1

input_group { "CALL - WIN", call_color = input { default="green", type =


input.color } }
input_group { "PUT - WIN", put_color = input { default="red", type =
input.color } }

function cores(open, close)


cor = 'd'
if open > close then
cor = 'r'

elseif open < close then


cor = 'g'

end

return cor .. ' '


end

sec = security(current_ticker_id, '5m')


ca=0

m2=iff(minute[ca]==2 or minute[ca]==12 or minute[ca]==22 or minute[ca]==32 or


minute[ca]==42 or minute[ca]==52,true,false)

m3=iff(minute[ca]==3 or minute[ca]==13 or minute[ca]==23 or minute[ca]==33 or


minute[ca]==43 or minute[ca]==53,true,false)

m4=iff(minute[ca]==4 or minute[ca]==14 or minute[ca]==24 or minute[ca]==34 or


minute[ca]==44 or minute[ca]==54,true,false)

m7=iff(minute[ca]==7 or minute[ca]==17 or minute[ca]==27 or minute[ca]==37 or


minute[ca]==47 or minute[ca]==57,true,false)

m8=iff(minute[ca]==8 or minute[ca]==18 or minute[ca]==28 or minute[ca]==38 or


minute[ca]==48 or minute[ca]==58,true,false)

m9=iff(minute[ca]==9 or minute[ca]==19 or minute[ca]==29 or minute[ca]==39 or


minute[ca]==49 or minute[ca]==59,true,false)

if m2==true or m7==true or m3==true or m8==true or m4==true or m9==true then

TD=iff(open>close,"red",iff(open<close,"lime","gray"))

pt=true

else

TD=nil
pt=false

end

plot_candle (open, high, low, close, "WRB", TD)

plot_shape(m4==true or
m9==true,"MHI",shape_style.cross,shape_size.large,rgba(0,0,0,0),shape_location.bott
om,1,"MHI","white")

if sec and (sec.open_time == open_time and tipo_mhi == 0) or (open_time ==


( sec.open_time + (tipo_mhi * 60) ) and tipo_mhi > 0) then

velas_cores = cores(open[1 + tipo_mhi], close[1 + tipo_mhi]) .. cores(open[2 +


tipo_mhi], close[2 + tipo_mhi]) .. cores(open[3 + tipo_mhi], close[3 + tipo_mhi])

_, count_d = string.gsub(velas_cores, 'd', '')

resultado = open_time - close_time

if count_d == 0 then
_, count_g = string.gsub(velas_cores, 'g', '')
_, count_r = string.gsub(velas_cores, 'r', '')

plot_shape((count_g > count_r and (open > close)),


'PUT',
shape_style.triangledown,
shape_size.huge,
put_color,
shape_location.abovebar,
0,
"PUT",
put_color)

plot_shape((count_g < count_r and (open < close)),


'CALL',
shape_style.triangleup,
shape_size.huge,
call_color,
shape_location.belowbar,
0,
"CALL",
call_color)

else
if exibir_doji == 1 then
drop_plot_value("PUT", current_bar_id)
drop_plot_value("CALL", current_bar_id)

end
end

end

instrument{name="MHIMH1
Sup/Res",icon='https://lh3.googleusercontent.com/ogw/ADea4I65OapvF7ZOUMZc_3J4Yx__qV
mvJD_jgzr4p8MZNks=s32-c-mo',overlay=true}
local function a()local
b=make_series()local c=high[2]

if not get_value(c)then
return b end;
local d=high<=c and high[1]<=c and high[3]<=c and high[4]<=c;
b:set(iff(d,c,b[1]))return b end;
local function e()local b=make_series()local c=low[2]if not get_value(c)then return
b end;
local d=low>=c and low[1]>=c and low[3]>=c and low[4]>=c;
b:set(iff(d,c,b[1]))return b end;
input_group{"Color",color=input{default="lime",type=input.color},width=input{defaul
t=1,type=input.line_width}}h=a()l=e()hline(h,"High",color,high_width)hline(l,"Low",
color,width)hline(highest(10)[1],"HH10",color,1)hline(lowest(10)
[1],"LL10",color,1)hline(highest(30)[1],"HH30",color,1)hline(lowest(30)
[1],"LL30",color,1)hline(highest(60)[1],"HH60",color,1)hline(lowest(60)
[1],"LL60",color,1)hline(highest(100)[1],"HH100",color,1)hline(lowest(100)
[1],"LL100",color,1)hline(highest(150)[1],"HH150",color,1)hline(lowest(150)
[1],"LL150",color,1)hline(highest(200)[1],"HH200",color,1)hline(lowest(200)
[1],"LL200",color,1)

You might also like