Looking for someone who can convert this tradingview indicator to MT5 and add an alert when 50% line is hit on H1 only.
Here is the link:https://www.tradingview.com/script/G...4-Daily-Range/
Here is the code:
study(title="Previous Day Range", shorttitle="Previous Day Range", overlay=true)
res = input(title="Resolution", type=resolution, defval="D")
dailyH = security(tickerid, res, high[1])
dailyL = security(tickerid, res, low[1])
dailyC = security(tickerid, res, close[1])
dailyO = security(tickerid, res, open[1])
midrange = (dailyH+dailyL)/2
midrangeup = (dailyH + midrange)/2
midrangedown = (dailyL + midrange)/2
// Daily line breaks
sopen = security(tickerid, res, open [1])
shigh = security(tickerid, res, high [1])
slow = security(tickerid, res, low [1])
sclose = security(tickerid, res, close [1])
// Color
dcolor=sopen != sopen[1] ? na : black
dcolor1=sopen != sopen[1] ? na : blue
dcolor2=sopen != sopen[1] ? na : black
plot(dailyH ? dailyH : na, title="Daily High", color=dcolor,linewidth=3)
plot(dailyL ? dailyL : na, title="Daily Low", color=dcolor, linewidth=3)
plot(midrange ? midrange : na, title="midrange", color=dcolor1, linewidth=2)
plot(midrangedown ? midrangedown : na, title="25%", color=dcolor2,linewidth=1)
plot(midrangeup ? midrangeup : na, title="75%", color=dcolor2,linewidth=1)
crossing_dailyH = close >= dailyH
crossing_dailyL = close <= dailyL
crossing_midrange = cross(close,midrange)
crossing_75 = cross(close,midrangeup)
crossing_25 = cross(close,midrangedown)
alert1 = crossing_dailyH or crossing_dailyL
alert2 = crossing_midrange
alert3 = crossing_75
alert4 = crossing_25
alertcondition(alert1, title='Range break', message='Price Breaking Range')
alertcondition(alert2, title='Midrange breaking', message= 'Price breeaking Mid Range')
alertcondition(alert3, title='75% Break', message= 'Price breaking 75% Range')
alertcondition(alert3, title='25% Break', message= 'Price breaking 25% Range')
Here is the link:https://www.tradingview.com/script/G...4-Daily-Range/
Here is the code:
study(title="Previous Day Range", shorttitle="Previous Day Range", overlay=true)
res = input(title="Resolution", type=resolution, defval="D")
dailyH = security(tickerid, res, high[1])
dailyL = security(tickerid, res, low[1])
dailyC = security(tickerid, res, close[1])
dailyO = security(tickerid, res, open[1])
midrange = (dailyH+dailyL)/2
midrangeup = (dailyH + midrange)/2
midrangedown = (dailyL + midrange)/2
// Daily line breaks
sopen = security(tickerid, res, open [1])
shigh = security(tickerid, res, high [1])
slow = security(tickerid, res, low [1])
sclose = security(tickerid, res, close [1])
// Color
dcolor=sopen != sopen[1] ? na : black
dcolor1=sopen != sopen[1] ? na : blue
dcolor2=sopen != sopen[1] ? na : black
plot(dailyH ? dailyH : na, title="Daily High", color=dcolor,linewidth=3)
plot(dailyL ? dailyL : na, title="Daily Low", color=dcolor, linewidth=3)
plot(midrange ? midrange : na, title="midrange", color=dcolor1, linewidth=2)
plot(midrangedown ? midrangedown : na, title="25%", color=dcolor2,linewidth=1)
plot(midrangeup ? midrangeup : na, title="75%", color=dcolor2,linewidth=1)
crossing_dailyH = close >= dailyH
crossing_dailyL = close <= dailyL
crossing_midrange = cross(close,midrange)
crossing_75 = cross(close,midrangeup)
crossing_25 = cross(close,midrangedown)
alert1 = crossing_dailyH or crossing_dailyL
alert2 = crossing_midrange
alert3 = crossing_75
alert4 = crossing_25
alertcondition(alert1, title='Range break', message='Price Breaking Range')
alertcondition(alert2, title='Midrange breaking', message= 'Price breeaking Mid Range')
alertcondition(alert3, title='75% Break', message= 'Price breaking 75% Range')
alertcondition(alert3, title='25% Break', message= 'Price breaking 25% Range')