Arron Meter With Alerts [Skiploss]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Skiploss

//@version=5
indicator(title = "Arron Meter With Alerts [Skiploss]", shorttitle = "AMWA v0.77")

// Setting
length  =   input(14, 'Length', group = 'Aroon Setting')
plotBull  =   input(title = "Plot Bullish", defval = true, group = 'Alert Settings')
plotBear  =   input(title = "Plot Bearish", defval = true, group = 'Alert Settings')

// Arron
upper = 100 * (ta.highestbars(high, length +1) + length) / length
lower = 100 * ( ta.lowestbars( low, length +1) + length) / length

// Style Setting
color_css_gradient_longmomentum   =   input(#bfcdcc,   'Aroon UP', group = 'Style Setting')
color_css_gradient_shortmomentum  =   input(#ff8e8e, 'Aroon Down', group = 'Style Setting')

// Aroon Meter
var meter = table.new(position.top_right,2,2)
if barstate.islast
    // 1st Row
    table.cell(meter, 0, 0, ' Aroon UP ', text_color = #787b86, bgcolor = na)
    table.cell(meter, 1, 0, 'Aroon Down', text_color = #787b86, bgcolor = na)
    // 2nd Row
    table.cell(meter, 0, 1, str.tostring(upper, '#.##')+'%', text_color = color_css_gradient_longmomentum, bgcolor = color.new(color_css_gradient_longmomentum,90))
    table.cell(meter, 1, 1, str.tostring(lower, '#.##')+'%', text_color = color_css_gradient_shortmomentum, bgcolor = color.new(color_css_gradient_shortmomentum,90))

// Plot Aroon
plot(upper, "Aroon Up", color=color_css_gradient_longmomentum)
plot(lower, "Aroon Down", color=color_css_gradient_shortmomentum)

// H Line
hline(115, color = #00000000)
hline(-15, color = #00000000)

// Signals
plotshape(plotBull == true and  ta.crossover(upper,lower) and ta.hma(close, 250) < ta.ema(close, 12)  and upper > 70 and lower < 70, title = "Bull", color = #8eff8e, textcolor = #000000, text = "Bull", style = shape.labelup, location = location.bottom, size = size.auto)
plotshape(plotBear == true and ta.crossunder(upper,lower) and ta.hma(close, 250) > ta.ema(close, 12) and lower > 70 and upper < 70, title = "Bear", color = #e8ff8e, textcolor = #000000, text = "Bear", style = shape.labeldown, location = location.top, size = size.auto)

// Alerts
alertcondition( ta.crossover(upper,lower) and ta.hma(close, 250) < ta.ema(close, 12) and upper > 70 and lower < 70, title = "Bullish Aroon", message =  "Focus Long Position on {{exchange}}:{{ticker}}")
alertcondition(ta.crossunder(upper,lower) and ta.hma(close, 250) > ta.ema(close, 12) and lower > 70 and upper < 70, title = "Bearish Aroon", message = "Focus Short Position on {{exchange}}:{{ticker}}")