alerts++
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © claireablani

// simple script to easily add alerts for a trade setup

// v.2 optional live P/L label
//     optional stop loss after 4h candle closes

// v.3 moved use_timeframe_stoploss below more important inputs
// v.3.1 fixing stoploss percentage rendering bug... missing onchart condition

// v.4 - alerts for gradations of buy zone and sl zone, will use this to trade haas email bot


//@version=5
indicator('alerts++', overlay=true)

activechart = syminfo.tickerid
show_ticker = input(false, title='show ticker label')
// ticker = input.string('KUCOIN:XRPUSDT', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
// on_chart = activechart == ticker


// COIN_1
ticker_1 = input.string('KUCOIN:BNBUSDT', title="", group='alert_1', inline='alert_1 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_1 = input.string('60', title="", group='alert_1', inline='alert_1 inline')
coin_1 = request.security(ticker_1, timeframe_1, close)
// plot(coin_1)
choice_1 = input(title="", group='alert_1', inline='alert_1 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_1 = input(0.0, title="", group='alert_1', inline='alert_1 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_1, target_1) and (choice_1 == "over" or choice_1 == "either"))
    alert('Alert_1 ' + ticker_1 + ' ' + timeframe_1 + " crossed over " + str.tostring(target_1) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_1, target_1) and (choice_1 == "under" or choice_1 == "either"))
    alert('Alert_1 ' + ticker_1 + ' ' + timeframe_1 + " crossed under " + str.tostring(target_1) , alert.freq_once_per_bar)


// COIN_2
ticker_2 = input.string('KUCOIN:BNBUSDT', title="", group='alert_2', inline='alert_2 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_2 = input.string('60', title="", group='alert_2', inline='alert_2 inline')
coin_2 = request.security(ticker_2, timeframe_2, close)
// plot(coin_2)
choice_2 = input(title="", group='alert_2', inline='alert_2 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_2 = input(0.0, title="", group='alert_2', inline='alert_2 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_2, target_2) and (choice_2 == "over" or choice_2 == "either"))
    alert('Alert_2 ' + ticker_2 + ' ' + timeframe_2 + " crossed over " + str.tostring(target_2) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_2, target_2) and (choice_2 == "under" or choice_2 == "either"))
    alert('Alert_2 ' + ticker_2 + ' ' + timeframe_2 + " crossed under " + str.tostring(target_2) , alert.freq_once_per_bar)
    
// COIN_3
ticker_3 = input.string('KUCOIN:BNBUSDT', title="", group='alert_3', inline='alert_3 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_3 = input.string('60', title="", group='alert_3', inline='alert_3 inline')
coin_3 = request.security(ticker_3, timeframe_3, close)
// plot(coin_3)
choice_3 = input(title="", group='alert_3', inline='alert_3 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_3 = input(0.0, title="", group='alert_3', inline='alert_3 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_3, target_3) and (choice_3 == "over" or choice_3 == "either"))
    alert('Alert_3 ' + ticker_3 + ' ' + timeframe_3 + " crossed over " + str.tostring(target_3) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_3, target_3) and (choice_3 == "under" or choice_3 == "either"))
    alert('Alert_3 ' + ticker_3 + ' ' + timeframe_3 + " crossed under " + str.tostring(target_3) , alert.freq_once_per_bar)
    

// COIN_4
ticker_4 = input.string('KUCOIN:BNBUSDT', title="", group='alert_4', inline='alert_4 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_4 = input.string('60', title="", group='alert_4', inline='alert_4 inline')
coin_4 = request.security(ticker_4, timeframe_4, close)
// plot(coin_4)
choice_4 = input(title="", group='alert_4', inline='alert_4 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_4 = input(0.0, title="", group='alert_4', inline='alert_4 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_4, target_4) and (choice_4 == "over" or choice_4 == "either"))
    alert('Alert_4 ' + ticker_4 + ' ' + timeframe_4 + " crossed over " + str.tostring(target_4) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_4, target_4) and (choice_4 == "under" or choice_4 == "either"))
    alert('Alert_4 ' + ticker_4 + ' ' + timeframe_4 + " crossed under " + str.tostring(target_4) , alert.freq_once_per_bar)
    
// COIN_5
ticker_5 = input.string('KUCOIN:BNBUSDT', title="", group='alert_5', inline='alert_5 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_5 = input.string('60', title="", group='alert_5', inline='alert_5 inline')
coin_5 = request.security(ticker_5, timeframe_5, close)
// plot(coin_5)
choice_5 = input(title="", group='alert_5', inline='alert_5 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_5 = input(0.0, title="", group='alert_5', inline='alert_5 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_5, target_5) and (choice_5 == "over" or choice_5 == "either"))
    alert('Alert_5 ' + ticker_5 + ' ' + timeframe_5 + " crossed over " + str.tostring(target_5) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_5, target_5) and (choice_5 == "under" or choice_5 == "either"))
    alert('Alert_5 ' + ticker_5 + ' ' + timeframe_5 + " crossed under " + str.tostring(target_5) , alert.freq_once_per_bar)
    
// COIN_6
ticker_6 = input.string('KUCOIN:BNBUSDT', title="", group='alert_6', inline='alert_6 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_6 = input.string('60', title="", group='alert_6', inline='alert_6 inline')
coin_6 = request.security(ticker_6, timeframe_6, close)
// plot(coin_6)
choice_6 = input(title="", group='alert_6', inline='alert_6 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_6 = input(0.0, title="", group='alert_6', inline='alert_6 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_6, target_6) and (choice_6 == "over" or choice_6 == "either"))
    alert('Alert_6 ' + ticker_6 + ' ' + timeframe_6 + " crossed over " + str.tostring(target_6) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_6, target_6) and (choice_6 == "under" or choice_6 == "either"))
    alert('Alert_6 ' + ticker_6 + ' ' + timeframe_6 + " crossed under " + str.tostring(target_6) , alert.freq_once_per_bar)
    
// COIN_7
ticker_7 = input.string('KUCOIN:BNBUSDT', title="", group='alert_7', inline='alert_7 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_7 = input.string('60', title="", group='alert_7', inline='alert_7 inline')
coin_7 = request.security(ticker_7, timeframe_7, close)
// plot(coin_7)
choice_7 = input(title="", group='alert_7', inline='alert_7 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_7 = input(0.0, title="", group='alert_7', inline='alert_7 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_7, target_7) and (choice_7 == "over" or choice_7 == "either"))
    alert('Alert_7 ' + ticker_7 + ' ' + timeframe_7 + " crossed over " + str.tostring(target_7) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_7, target_7) and (choice_7 == "under" or choice_7 == "either"))
    alert('Alert_7 ' + ticker_7 + ' ' + timeframe_7 + " crossed under " + str.tostring(target_7) , alert.freq_once_per_bar)
    
// COIN_8
ticker_8 = input.string('KUCOIN:BNBUSDT', title="", group='alert_8', inline='alert_8 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_8 = input.string('60', title="", group='alert_8', inline='alert_8 inline')
coin_8 = request.security(ticker_8, timeframe_8, close)
// plot(coin_8)
choice_8 = input(title="", group='alert_8', inline='alert_8 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_8 = input(0.0, title="", group='alert_8', inline='alert_8 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_8, target_8) and (choice_8 == "over" or choice_8 == "either"))
    alert('Alert_8 ' + ticker_8 + ' ' + timeframe_8 + " crossed over " + str.tostring(target_8) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_8, target_8) and (choice_8 == "under" or choice_8 == "either"))
    alert('Alert_8 ' + ticker_8 + ' ' + timeframe_8 + " crossed under " + str.tostring(target_8) , alert.freq_once_per_bar)
    
// COIN_9
ticker_9 = input.string('KUCOIN:BNBUSDT', title="", group='alert_9', inline='alert_9 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_9 = input.string('60', title="", group='alert_9', inline='alert_9 inline')
coin_9 = request.security(ticker_9, timeframe_9, close)
// plot(coin_9)
choice_9 = input(title="", group='alert_9', inline='alert_9 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_9 = input(0.0, title="", group='alert_9', inline='alert_9 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_9, target_9) and (choice_9 == "over" or choice_9 == "either"))
    alert('Alert_9 ' + ticker_9 + ' ' + timeframe_9 + " crossed over " + str.tostring(target_9) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_9, target_9) and (choice_9 == "under" or choice_9 == "either"))
    alert('Alert_9 ' + ticker_9 + ' ' + timeframe_9 + " crossed under " + str.tostring(target_9) , alert.freq_once_per_bar)
    
// COIN_10
ticker_10 = input.string('KUCOIN:BNBUSDT', title="", group='alert_10', inline='alert_10 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_10 = input.string('60', title="", group='alert_10', inline='alert_10 inline')
coin_10 = request.security(ticker_10, timeframe_10, close)
// plot(coin_10)
choice_10 = input(title="", group='alert_10', inline='alert_10 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_10 = input(0.0, title="", group='alert_10', inline='alert_10 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_10, target_10) and (choice_10 == "over" or choice_10 == "either"))
    alert('Alert_10 ' + ticker_10 + ' ' + timeframe_10 + " crossed over " + str.tostring(target_10) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_10, target_10) and (choice_10 == "under" or choice_10 == "either"))
    alert('Alert_10 ' + ticker_10 + ' ' + timeframe_10 + " crossed under " + str.tostring(target_10) , alert.freq_once_per_bar)
    
// COIN_11
ticker_11 = input.string('KUCOIN:BNBUSDT', title="", group='alert_11', inline='alert_11 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_11 = input.string('60', title="", group='alert_11', inline='alert_11 inline')
coin_11 = request.security(ticker_11, timeframe_11, close)
// plot(coin_11)
choice_11 = input(title="", group='alert_11', inline='alert_11 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_11 = input(0.0, title="", group='alert_11', inline='alert_11 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_11, target_11) and (choice_11 == "over" or choice_11 == "either"))
    alert('Alert_11 ' + ticker_11 + ' ' + timeframe_11 + " crossed over " + str.tostring(target_11) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_11, target_11) and (choice_11 == "under" or choice_11 == "either"))
    alert('Alert_11 ' + ticker_11 + ' ' + timeframe_11 + " crossed under " + str.tostring(target_11) , alert.freq_once_per_bar)


// COIN_12
ticker_12 = input.string('KUCOIN:BNBUSDT', title="", group='alert_12', inline='alert_12 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_12 = input.string('60', title="", group='alert_12', inline='alert_12 inline')
coin_12 = request.security(ticker_12, timeframe_12, close)
// plot(coin_12)
choice_12 = input(title="", group='alert_12', inline='alert_12 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_12 = input(0.0, title="", group='alert_12', inline='alert_12 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_12, target_12) and (choice_12 == "over" or choice_12 == "either"))
    alert('Alert_12 ' + ticker_12 + ' ' + timeframe_12 + " crossed over " + str.tostring(target_12) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_12, target_12) and (choice_12 == "under" or choice_12 == "either"))
    alert('Alert_12 ' + ticker_12 + ' ' + timeframe_12 + " crossed under " + str.tostring(target_12) , alert.freq_once_per_bar)
    
// COIN_13
ticker_13 = input.string('KUCOIN:BNBUSDT', title="", group='alert_13', inline='alert_13 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_13 = input.string('60', title="", group='alert_13', inline='alert_13 inline')
coin_13 = request.security(ticker_13, timeframe_13, close)
// plot(coin_13)
choice_13 = input(title="", group='alert_13', inline='alert_13 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_13 = input(0.0, title="", group='alert_13', inline='alert_13 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_13, target_13) and (choice_13 == "over" or choice_13 == "either"))
    alert('Alert_13 ' + ticker_13 + ' ' + timeframe_13 + " crossed over " + str.tostring(target_13) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_13, target_13) and (choice_13 == "under" or choice_13 == "either"))
    alert('Alert_13 ' + ticker_13 + ' ' + timeframe_13 + " crossed under " + str.tostring(target_13) , alert.freq_once_per_bar)
    

// COIN_14
ticker_14 = input.string('KUCOIN:BNBUSDT', title="", group='alert_14', inline='alert_14 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_14 = input.string('60', title="", group='alert_14', inline='alert_14 inline')
coin_14 = request.security(ticker_14, timeframe_14, close)
// plot(coin_14)
choice_14 = input(title="", group='alert_14', inline='alert_14 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_14 = input(0.0, title="", group='alert_14', inline='alert_14 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_14, target_14) and (choice_14 == "over" or choice_14 == "either"))
    alert('Alert_14 ' + ticker_14 + ' ' + timeframe_14 + " crossed over " + str.tostring(target_14) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_14, target_14) and (choice_14 == "under" or choice_14 == "either"))
    alert('Alert_14 ' + ticker_14 + ' ' + timeframe_14 + " crossed under " + str.tostring(target_14) , alert.freq_once_per_bar)
    
// COIN_15
ticker_15 = input.string('KUCOIN:BNBUSDT', title="", group='alert_15', inline='alert_15 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_15 = input.string('60', title="", group='alert_15', inline='alert_15 inline')
coin_15 = request.security(ticker_15, timeframe_15, close)
// plot(coin_15)
choice_15 = input(title="", group='alert_15', inline='alert_15 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_15 = input(0.0, title="", group='alert_15', inline='alert_15 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_15, target_15) and (choice_15 == "over" or choice_15 == "either"))
    alert('Alert_15 ' + ticker_15 + ' ' + timeframe_15 + " crossed over " + str.tostring(target_15) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_15, target_15) and (choice_15 == "under" or choice_15 == "either"))
    alert('Alert_15 ' + ticker_15 + ' ' + timeframe_15 + " crossed under " + str.tostring(target_15) , alert.freq_once_per_bar)
    
// COIN_16
ticker_16 = input.string('KUCOIN:BNBUSDT', title="", group='alert_16', inline='alert_16 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_16 = input.string('60', title="", group='alert_16', inline='alert_16 inline')
coin_16 = request.security(ticker_16, timeframe_16, close)
// plot(coin_16)
choice_16 = input(title="", group='alert_16', inline='alert_16 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_16 = input(0.0, title="", group='alert_16', inline='alert_16 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_16, target_16) and (choice_16 == "over" or choice_16 == "either"))
    alert('Alert_16 ' + ticker_16 + ' ' + timeframe_16 + " crossed over " + str.tostring(target_16) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_16, target_16) and (choice_16 == "under" or choice_16 == "either"))
    alert('Alert_16 ' + ticker_16 + ' ' + timeframe_16 + " crossed under " + str.tostring(target_16) , alert.freq_once_per_bar)
    
// COIN_17
ticker_17 = input.string('KUCOIN:BNBUSDT', title="", group='alert_17', inline='alert_17 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_17 = input.string('60', title="", group='alert_17', inline='alert_17 inline')
coin_17 = request.security(ticker_17, timeframe_17, close)
// plot(coin_17)
choice_17 = input(title="", group='alert_17', inline='alert_17 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_17 = input(0.0, title="", group='alert_17', inline='alert_17 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_17, target_17) and (choice_17 == "over" or choice_17 == "either"))
    alert('Alert_17 ' + ticker_17 + ' ' + timeframe_17 + " crossed over " + str.tostring(target_17) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_17, target_17) and (choice_17 == "under" or choice_17 == "either"))
    alert('Alert_17 ' + ticker_17 + ' ' + timeframe_17 + " crossed under " + str.tostring(target_17) , alert.freq_once_per_bar)
    
// COIN_18
ticker_18 = input.string('KUCOIN:BNBUSDT', title="", group='alert_18', inline='alert_18 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_18 = input.string('60', title="", group='alert_18', inline='alert_18 inline')
coin_18 = request.security(ticker_18, timeframe_18, close)
// plot(coin_18)
choice_18 = input(title="", group='alert_18', inline='alert_18 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_18 = input(0.0, title="", group='alert_18', inline='alert_18 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_18, target_18) and (choice_18 == "over" or choice_18 == "either"))
    alert('Alert_18 ' + ticker_18 + ' ' + timeframe_18 + " crossed over " + str.tostring(target_18) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_18, target_18) and (choice_18 == "under" or choice_18 == "either"))
    alert('Alert_18 ' + ticker_18 + ' ' + timeframe_18 + " crossed under " + str.tostring(target_18) , alert.freq_once_per_bar)
    
// COIN_19
ticker_19 = input.string('KUCOIN:BNBUSDT', title="", group='alert_19', inline='alert_19 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_19 = input.string('60', title="", group='alert_19', inline='alert_19 inline')
coin_19 = request.security(ticker_19, timeframe_19, close)
// plot(coin_19)
choice_19 = input(title="", group='alert_19', inline='alert_19 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_19 = input(0.0, title="", group='alert_19', inline='alert_19 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_19, target_19) and (choice_19 == "over" or choice_19 == "either"))
    alert('Alert_19 ' + ticker_19 + ' ' + timeframe_19 + " crossed over " + str.tostring(target_19) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_19, target_19) and (choice_19 == "under" or choice_19 == "either"))
    alert('Alert_19 ' + ticker_19 + ' ' + timeframe_19 + " crossed under " + str.tostring(target_19) , alert.freq_once_per_bar)
    
// COIN_20
ticker_20 = input.string('KUCOIN:BNBUSDT', title="", group='alert_20', inline='alert_20 inline', tooltip='In the format of EXCHANGE:BASEQUOTE, i.e. KUCOIN:BTCUSDT. Use \'Show Ticker Label\' checkbox to display the ticker on a label. Make sure to uncheck it afterwards.')
timeframe_20 = input.string('60', title="", group='alert_20', inline='alert_20 inline')
coin_20 = request.security(ticker_20, timeframe_20, close)
// plot(coin_20)
choice_20 = input(title="", group='alert_20', inline='alert_20 inline', defval="over", tooltip='Write in "over", "under", or "either"') // options=["cross up"])
target_20 = input(0.0, title="", group='alert_20', inline='alert_20 inline', tooltip="ticker__timeframe__over/under/either__target price")

// cross over or either
if(ta.crossover(coin_20, target_20) and (choice_20 == "over" or choice_20 == "either"))
    alert('Alert_20 ' + ticker_20 + ' ' + timeframe_20 + " crossed over " + str.tostring(target_20) , alert.freq_once_per_bar)
// cross under or either
if(ta.crossunder(coin_20, target_20) and (choice_20 == "under" or choice_20 == "either"))
    alert('Alert_20 ' + ticker_20 + ' ' + timeframe_20 + " crossed under " + str.tostring(target_20) , alert.freq_once_per_bar)
    



    


// label for debug    
var label debug_label = na
label.delete(debug_label)  // delete previous labels
debug_label_text = syminfo.tickerid


// debug_label_text := tostring(array.size(buy_levels))
debug_label := label.new(x=time, xloc=xloc.bar_time, y=close, size=size.normal, text=debug_label_text, color=color.new(color.blue, 50), textcolor=color.new(color.white, show_ticker ? 0 : 100), style=show_ticker ? label.style_label_up : label.style_none)



