title: Hi I am trying to create a MACD Divergence screener for Multiple tickers, => within => possible?
body: <p>Hi so I am trying to create a screener that will produce alerts for multiple tickers but when putting the Divergence code in as the function. It has a function alreay Im guessing you cant put a function within the function, is there a work around or a short cut some wizard could show me how to do thanks?</p>
  <pre><code>indicator('MACD Multiple Alerts', overlay=false)
  // alert.freq_once_per_bar_close added to array
  
  
  fast_length = input(title='Fast Length', defval=12)
  slow_length = input(title='Slow Length', defval=26)
  src = input(title='Source', defval=close)
  signal_length = input.int(title='Signal Smoothing', minval=1, maxval=50, defval=9)
  sma_source = input.string(title='Oscillator MA Type', defval='EMA', options=['SMA', 'EMA'])
  sma_signal = input.string(title='Signal Line MA Type', defval='EMA', options=['SMA', 'EMA'])
  
  // Calculating
  fast_ma = sma_source == 'SMA' ? ta.sma(src, fast_length) : ta.ema(src, fast_length)
  slow_ma = sma_source == 'SMA' ? ta.sma(src, slow_length) : ta.ema(src, slow_length)
  macd = fast_ma - slow_ma
  signal = sma_signal == 'SMA' ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)
  hist = macd - signal
  
  
  
  donttouchzero = input(title='Don\'t touch the zero line?', defval=true)
  
  lbR = input(title='Pivot Lookback Right', defval=5)
  lbL = input(title='Pivot Lookback Left', defval=5)
  rangeUpper = input(title='Max of Lookback Range', defval=60)
  rangeLower = input(title='Min of Lookback Range', defval=5)
  // function V
  
  //function ^
  hiddenBullCond =  priceHL and oscLL and plFound
  
  hiddenBearCond = priceLH and oscHH and phFound
  
  
  
  alertcondition(bullCond, title='Bull', message='Regular Bull Div {{ticker}} XXmin')
  alertcondition(bearCond, title='Bear', message='Regular Bear Div {{ticker}} XXmin')
  alertcondition(hiddenBullCond, title='H Bull', message='Hidden Bull Div {{ticker}} XXmin')
  alertcondition(hiddenBearCond, title='H Bear', message='Hidden Bear Div {{ticker}} XXmin')
  
  ///////MACD INPUT//////
  fastLength = input(12)
  slowlength = input(26)
  MACDLength = input(9)
  timeFrame   =input.timeframe('5',&quot;Resolution&quot;, options=['5','30','60','120','240','D', 'W', 'M'])
  
  
  
  // SYMBOLS // 
  
  u01 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's01')
  u02 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's02')
  u03 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's03')
  u04 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's04')
  u05 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's05')
  u06 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's06')
  u07 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's07')
  u08 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's08')
  u09 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's09')
  u10 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's10')
  u11 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's11')
  u12 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's12')
  u13 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's13')
  u14 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's14')
  u15 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's15')
  u16 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's16')
  u17 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's17')
  u18 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's18')
  u19 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's19')
  u20 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's20')
  u21 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's21')
  u22 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's22')
  u23 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's23')
  u24 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's24')
  u25 = input.bool(false,  title = &quot;&quot;, group = 'Symbols', inline = 's25')
  u26 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's26')
  u27 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's27')
  u28 = input.bool(false,  title = &quot;&quot;, group = 'Symbols', inline = 's28')
  u29 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's29')
  u30 = input.bool(true,  title = &quot;&quot;, group = 'Symbols', inline = 's30')
  
  
  s01 = input.symbol('XRPUSDT',  group = 'Symbols', inline = 's01')
  s02 = input.symbol('BTCUSDT',  group = 'Symbols', inline = 's02')
  s03 = input.symbol('ETHUSDT ', group = 'Symbols', inline = 's03')
  s04 = input.symbol('EIGHTCAP:GER30',  group = 'Symbols', inline = 's04')
  s05 = input.symbol('BNBUSDT',  group = 'Symbols', inline = 's05')
  s06 = input.symbol('SOLUSDT',  group = 'Symbols', inline = 's06')
  s07 = input.symbol('ADAUSDT',   group = 'Symbols', inline = 's07')
  s08 = input.symbol('ZILUSDT',  group = 'Symbols', inline = 's08')
  s09 = input.symbol('OANDA:EURAUD',  group = 'Symbols', inline = 's09')
  s10 = input.symbol('OANDA:EURCAD',  group = 'Symbols', inline = 's10')
  s11 = input.symbol('OANDA:EURCHF',  group = 'Symbols', inline = 's11')
  s12 = input.symbol('OANDA:EURUSD',  group = 'Symbols', inline = 's12')
  s13 = input.symbol('OANDA:GBPUSD',  group = 'Symbols', inline = 's13')
  s14 = input.symbol('OANDA:USDCAD',   group = 'Symbols', inline = 's14')
  s15 = input.symbol('OANDA:USDCHF',   group = 'Symbols', inline = 's15')
  s16 = input.symbol('OANDA:XAGUSD',  group = 'Symbols', inline = 's16')
  s17 = input.symbol('OANDA:AUDUSD',  group = 'Symbols', inline = 's17')
  s18 = input.symbol('OANDA:EURGBP',  group = 'Symbols', inline = 's18')
  s19 = input.symbol('OANDA:USDJPY',  group = 'Symbols', inline = 's19')
  s20 = input.symbol('OANDA:NZDJPY',  group = 'Symbols', inline = 's20')
  s21 = input.symbol('DOTUSDT',  group = 'Symbols', inline = 's21') 
  s22 = input.symbol('MATICUSDT',  group = 'Symbols', inline = 's22')
  s23 = input.symbol('OANDA:UK100GBP',  group = 'Symbols', inline = 's23')
  s24 = input.symbol('OANDA:NZDUSD',   group = 'Symbols', inline = 's24')
  s25 = input.symbol('DASHUSDT', group = 'Symbols', inline = 's25')
  s26 = input.symbol('OANDA:NZDCHF',  group = 'Symbols', inline = 's26')
  s27 = input.symbol('OANDA:GBPCAD', group = 'Symbols', inline = 's27')
  s28 = input.symbol('OANDA:BCOUSD',   group = 'Symbols', inline = 's28')
  s29 = input.symbol('OANDA:AUDCAD', group = 'Symbols', inline = 's29')
  s30 = input.symbol('OANDA:AUDCHF',   group = 'Symbols', inline = 's30') 
  
  
  //////////////////
  // CALCULATIONS //
  
  
  
  // Get only symbol
  only_symbol(s) =&gt; 
      array.get(str.split(s, &quot;:&quot;), 1)
  
  
  
      
  screener_func() =&gt;
      
      
      osc = macd
      
      plFound = na(ta.pivotlow(osc, lbL, lbR)) ? false : true
      phFound = na(ta.pivothigh(osc, lbL, lbR)) ? false : true
      _inRange(cond) =&gt;
          bars = ta.barssince(cond == true)
          rangeLower &lt;= bars and bars &lt;= rangeUpper
      
      oscHL = osc[lbR] &gt; ta.valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1]) and osc[lbR] &lt; 0
      
      priceLL = low[lbR] &lt; ta.valuewhen(plFound, low[lbR], 1)
      priceHHZero = ta.highest(osc, lbL + lbR + 5)
      
      blowzero = donttouchzero ? priceHHZero &lt; 0 : true
      bullCond = priceLL and oscHL and plFound and blowzero //plotBull and 
      
      
      oscLL = osc[lbR] &lt; ta.valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])
      
      priceHL = low[lbR] &gt; ta.valuewhen(plFound, low[lbR], 1)
      
      
      oscLH = osc[lbR] &lt; ta.valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1]) and osc[lbR] &gt; 0
      
      priceLLZero = ta.lowest(osc, lbL + lbR + 5)
      
      bearzero = donttouchzero ? priceLLZero &gt; 0 : true
      
      
      priceHH = high[lbR] &gt; ta.valuewhen(phFound, high[lbR], 1)
      
      bearCond = priceHH and oscLH and phFound and bearzero 
      
      oscHH = osc[lbR] &gt; ta.valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])
      
      
      priceLH = high[lbR] &lt; ta.valuewhen(phFound, high[lbR], 1)
      MACD_Div = bullCond ? 1 : bearCond ? -1 : 0
  
      
      [close, MACD_Div]
  
  // Security call
  [cl01, MACDCrossInt01] = request.security(s01, timeFrame, screener_func())
  [cl02, MACDCrossInt02] = request.security(s02, timeFrame, screener_func())
  [cl03, MACDCrossInt03] = request.security(s03, timeFrame, screener_func())
  [cl04, MACDCrossInt04] = request.security(s04, timeFrame, screener_func())
  [cl05, MACDCrossInt05] = request.security(s05, timeFrame, screener_func())
  [cl06, MACDCrossInt06] = request.security(s06, timeFrame, screener_func())
  [cl07, MACDCrossInt07] = request.security(s07, timeFrame, screener_func())
  [cl08, MACDCrossInt08] = request.security(s08, timeFrame, screener_func())
  [cl09, MACDCrossInt09] = request.security(s09, timeFrame, screener_func())
  [cl10, MACDCrossInt10] = request.security(s10, timeFrame, screener_func())
  [cl11, MACDCrossInt11] = request.security(s11, timeFrame, screener_func())
  [cl12, MACDCrossInt12] = request.security(s12, timeFrame, screener_func())
  [cl13, MACDCrossInt13] = request.security(s13, timeFrame, screener_func())
  [cl14, MACDCrossInt14] = request.security(s14, timeFrame, screener_func())
  [cl15, MACDCrossInt15] = request.security(s15, timeFrame, screener_func())
  [cl16, MACDCrossInt16] = request.security(s16, timeFrame, screener_func())
  [cl17, MACDCrossInt17] = request.security(s17, timeFrame, screener_func())
  [cl18, MACDCrossInt18] = request.security(s18, timeFrame, screener_func())
  [cl19, MACDCrossInt19] = request.security(s19, timeFrame, screener_func())
  [cl20, MACDCrossInt20] = request.security(s20, timeFrame, screener_func())
  [cl21, MACDCrossInt21] = request.security(s21, timeFrame, screener_func())
  [cl22, MACDCrossInt22] = request.security(s22, timeFrame, screener_func())
  [cl23, MACDCrossInt23] = request.security(s23, timeFrame, screener_func())
  [cl24, MACDCrossInt24] = request.security(s24, timeFrame, screener_func())
  [cl25, MACDCrossInt25] = request.security(s25, timeFrame, screener_func())
  [cl26, MACDCrossInt26] = request.security(s26, timeFrame, screener_func())
  [cl27, MACDCrossInt27] = request.security(s27, timeFrame, screener_func())
  [cl28, MACDCrossInt28] = request.security(s28, timeFrame, screener_func())
  [cl29, MACDCrossInt29] = request.security(s29, timeFrame, screener_func())
  [cl30, MACDCrossInt30] = request.security(s30, timeFrame, screener_func())
  
  
  
  ////////////
  // ARRAYS //
  
  s_arr   = array.new_string(0)
  u_arr   = array.new_bool(0)
  cl_arr  = array.new_float(0)
  MACD_Div_Int_arr = array.new_int(0)
  MACDCrossBool_arr = array.new_bool(0)
  
  // Add Symbols 
  array.push(s_arr, only_symbol(s01))
  array.push(s_arr, only_symbol(s02))
  array.push(s_arr, only_symbol(s03))
  array.push(s_arr, only_symbol(s04))
  array.push(s_arr, only_symbol(s05))
  array.push(s_arr, only_symbol(s06))
  array.push(s_arr, only_symbol(s07))
  array.push(s_arr, only_symbol(s08))
  array.push(s_arr, only_symbol(s09))
  array.push(s_arr, only_symbol(s10))
  array.push(s_arr, only_symbol(s11))
  array.push(s_arr, only_symbol(s12))
  array.push(s_arr, only_symbol(s13))
  array.push(s_arr, only_symbol(s14))
  array.push(s_arr, only_symbol(s15))
  array.push(s_arr, only_symbol(s16))
  array.push(s_arr, only_symbol(s17))
  array.push(s_arr, only_symbol(s18))
  array.push(s_arr, only_symbol(s19))
  array.push(s_arr, only_symbol(s20))
  array.push(s_arr, only_symbol(s21))
  array.push(s_arr, only_symbol(s22))
  array.push(s_arr, only_symbol(s23))
  array.push(s_arr, only_symbol(s24))
  array.push(s_arr, only_symbol(s25))
  array.push(s_arr, only_symbol(s26))
  array.push(s_arr, only_symbol(s27))
  array.push(s_arr, only_symbol(s28))
  array.push(s_arr, only_symbol(s29))
  array.push(s_arr, only_symbol(s30))
  
  
  ///////////
  // CLOSE //
  
  array.push(cl_arr, cl01)
  array.push(cl_arr, cl02)
  array.push(cl_arr, cl03)
  array.push(cl_arr, cl04)
  array.push(cl_arr, cl05)
  array.push(cl_arr, cl06)
  array.push(cl_arr, cl07)
  array.push(cl_arr, cl08)
  array.push(cl_arr, cl09)
  array.push(cl_arr, cl10)
  array.push(cl_arr, cl11)
  array.push(cl_arr, cl12)
  array.push(cl_arr, cl13)
  array.push(cl_arr, cl14)
  array.push(cl_arr, cl15)
  array.push(cl_arr, cl16)
  array.push(cl_arr, cl17)
  array.push(cl_arr, cl18)
  array.push(cl_arr, cl19)
  array.push(cl_arr, cl20)
  array.push(cl_arr, cl21)
  array.push(cl_arr, cl22)
  array.push(cl_arr, cl23)
  array.push(cl_arr, cl24)
  array.push(cl_arr, cl25)
  array.push(cl_arr, cl26)
  array.push(cl_arr, cl27)
  array.push(cl_arr, cl28)
  array.push(cl_arr, cl29)
  array.push(cl_arr, cl30)
  
  
  
  // Symbol bool
  
  array.push(u_arr, u01)
  array.push(u_arr, u02)
  array.push(u_arr, u03)
  array.push(u_arr, u04)
  array.push(u_arr, u05)
  array.push(u_arr, u06)
  array.push(u_arr, u07)
  array.push(u_arr, u08)
  array.push(u_arr, u09)
  array.push(u_arr, u10)
  array.push(u_arr, u11)
  array.push(u_arr, u12)
  array.push(u_arr, u13)
  array.push(u_arr, u14)
  array.push(u_arr, u15)
  array.push(u_arr, u16)
  array.push(u_arr, u17)
  array.push(u_arr, u18)
  array.push(u_arr, u19)
  array.push(u_arr, u20)
  array.push(u_arr, u21)
  array.push(u_arr, u22)
  array.push(u_arr, u23)
  array.push(u_arr, u24)
  array.push(u_arr, u25)
  array.push(u_arr, u26)
  array.push(u_arr, u27)
  array.push(u_arr, u28)
  array.push(u_arr, u29)
  array.push(u_arr, u30)
  
  
  
  
  // EMA CROSS
  
  
  array.push(MACD_Div_Int_arr, MACDCrossInt01)
  array.push(MACD_Div_Int_arr, MACDCrossInt02)
  array.push(MACD_Div_Int_arr, MACDCrossInt03)
  array.push(MACD_Div_Int_arr, MACDCrossInt04)
  array.push(MACD_Div_Int_arr, MACDCrossInt05)
  array.push(MACD_Div_Int_arr, MACDCrossInt06)
  array.push(MACD_Div_Int_arr, MACDCrossInt07)
  array.push(MACD_Div_Int_arr, MACDCrossInt08)
  array.push(MACD_Div_Int_arr, MACDCrossInt09)
  array.push(MACD_Div_Int_arr, MACDCrossInt10)
  array.push(MACD_Div_Int_arr, MACDCrossInt11)
  array.push(MACD_Div_Int_arr, MACDCrossInt12)
  array.push(MACD_Div_Int_arr, MACDCrossInt13)
  array.push(MACD_Div_Int_arr, MACDCrossInt14)
  array.push(MACD_Div_Int_arr, MACDCrossInt15)
  array.push(MACD_Div_Int_arr, MACDCrossInt16)
  array.push(MACD_Div_Int_arr, MACDCrossInt17)
  array.push(MACD_Div_Int_arr, MACDCrossInt18)
  array.push(MACD_Div_Int_arr, MACDCrossInt19)
  array.push(MACD_Div_Int_arr, MACDCrossInt20)
  array.push(MACD_Div_Int_arr, MACDCrossInt21)
  array.push(MACD_Div_Int_arr, MACDCrossInt22)
  array.push(MACD_Div_Int_arr, MACDCrossInt23)
  array.push(MACD_Div_Int_arr, MACDCrossInt24)
  array.push(MACD_Div_Int_arr, MACDCrossInt25)
  array.push(MACD_Div_Int_arr, MACDCrossInt26)
  array.push(MACD_Div_Int_arr, MACDCrossInt27)
  array.push(MACD_Div_Int_arr, MACDCrossInt28)
  array.push(MACD_Div_Int_arr, MACDCrossInt29)
  array.push(MACD_Div_Int_arr, MACDCrossInt30)
  
  
  
  
  
  // Alert             
  
  if array.get(u_arr, 0)
      if array.get(MACD_Div_Int_arr, 0) == 1  
          alert(array.get(s_arr, 0)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)  
      if array.get(MACD_Div_Int_arr, 0) == -1 
          alert(array.get(s_arr, 0)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)  
          
  if array.get(u_arr, 1)
      if array.get(MACD_Div_Int_arr, 1) == 1
          alert(array.get(s_arr, 1)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 1) == -1
          alert(array.get(s_arr, 1)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 2)
      if array.get(MACD_Div_Int_arr, 2) == 1
          alert(array.get(s_arr, 2)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 2) == -1
          alert(array.get(s_arr, 2)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 3)
      if array.get(MACD_Div_Int_arr, 3) == 1
          alert(array.get(s_arr, 3)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 3) == -1
          alert(array.get(s_arr, 3)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 4)
      if array.get(MACD_Div_Int_arr, 4) == 1
          alert(array.get(s_arr, 4)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 4) == -1
          alert(array.get(s_arr, 4)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 5)
      if array.get(MACD_Div_Int_arr, 5) == 1
          alert(array.get(s_arr, 5)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 5) == -1
          alert(array.get(s_arr, 5)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 6)
      if array.get(MACD_Div_Int_arr, 6) == 1
          alert(array.get(s_arr, 6)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 6) == -1
          alert(array.get(s_arr, 6)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 7)
      if array.get(MACD_Div_Int_arr, 7) == 1
          alert(array.get(s_arr, 7)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 7) == -1
          alert(array.get(s_arr, 7)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 8)
      if array.get(MACD_Div_Int_arr, 8) == 1
          alert(array.get(s_arr, 8)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 8) == -1
          alert(array.get(s_arr, 8)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 9)
      if array.get(MACD_Div_Int_arr, 9) == 1
          alert(array.get(s_arr, 9)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 9) == -1
          alert(array.get(s_arr, 9)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 10)
      if array.get(MACD_Div_Int_arr, 10) == 1
          alert(array.get(s_arr, 10)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 10) == -1
          alert(array.get(s_arr, 10)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 11)
      if array.get(MACD_Div_Int_arr, 11) == 1
          alert(array.get(s_arr, 11)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 11) == -1
          alert(array.get(s_arr, 11)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 12)
      if array.get(MACD_Div_Int_arr, 12) == 1
          alert(array.get(s_arr, 12)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 12) == -1
          alert(array.get(s_arr, 12)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 13)
      if array.get(MACD_Div_Int_arr, 13) == 1
          alert(array.get(s_arr, 13)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 13) == -1
          alert(array.get(s_arr, 13)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 14)
      if array.get(MACD_Div_Int_arr, 14) == 1
          alert(array.get(s_arr, 14)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 14) == -1
          alert(array.get(s_arr, 14)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 15)
      if array.get(MACD_Div_Int_arr, 15) == 1
          alert(array.get(s_arr, 15)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 15) == -1
          alert(array.get(s_arr, 15)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 16)
      if array.get(MACD_Div_Int_arr, 16) == 1
          alert(array.get(s_arr, 16)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 16) == -1
          alert(array.get(s_arr, 16)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
          
  if array.get(u_arr, 17)
      if array.get(MACD_Div_Int_arr, 17) == 1
          alert(array.get(s_arr, 17)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 17) == -1
          alert(array.get(s_arr, 17)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 18)
      if array.get(MACD_Div_Int_arr, 18) == 1
          alert(array.get(s_arr, 18)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 18) == -1
          alert(array.get(s_arr, 18)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)       
  
  if array.get(u_arr, 19)
      if array.get(MACD_Div_Int_arr, 19) == 1
          alert(array.get(s_arr, 19)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 19) == -1
          alert(array.get(s_arr, 19)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 20)
      if array.get(MACD_Div_Int_arr, 20) == 1
          alert(array.get(s_arr, 20)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 20) == -1
          alert(array.get(s_arr, 20)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 21)
      if array.get(MACD_Div_Int_arr, 21) == 1
          alert(array.get(s_arr, 21)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 21) == -1
          alert(array.get(s_arr, 21)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 22)
      if array.get(MACD_Div_Int_arr, 22) == 1
          alert(array.get(s_arr, 22)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 22) == -1
          alert(array.get(s_arr, 22)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
      
  if array.get(u_arr, 23)
      if array.get(MACD_Div_Int_arr, 23) == 1
          alert(array.get(s_arr, 23)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 23) == -1
          alert(array.get(s_arr, 23)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 24)
      if array.get(MACD_Div_Int_arr, 24) == 1
          alert(array.get(s_arr, 24)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 24) == -1
          alert(array.get(s_arr, 24)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 25)
      if array.get(MACD_Div_Int_arr, 25) == 1
          alert(array.get(s_arr, 25)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 25) == -1
          alert(array.get(s_arr, 25)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 26)
      if array.get(MACD_Div_Int_arr, 26) == 1
          alert(array.get(s_arr, 26)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 26) == -1
          alert(array.get(s_arr, 26)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 27)
      if array.get(MACD_Div_Int_arr, 27) == 1 and barstate.isconfirmed
          alert(array.get(s_arr, 27)+&quot;CrossOver&quot;)
      if array.get(MACD_Div_Int_arr, 27) == -1 and barstate.isconfirmed
          alert(array.get(s_arr, 27)+&quot;CrossUnder&quot;)
  
  if array.get(u_arr, 28)
      if array.get(MACD_Div_Int_arr, 28) == 1
          alert(array.get(s_arr, 28)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 28) == -1
          alert(array.get(s_arr, 28)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 26)
      if array.get(MACD_Div_Int_arr, 26) == 1
          alert(array.get(s_arr, 26)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 26) == -1
          alert(array.get(s_arr, 26)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  if array.get(u_arr, 29)
      if array.get(MACD_Div_Int_arr, 29) == 1
          alert(array.get(s_arr, 29)+&quot;CrossOver&quot;,alert.freq_once_per_bar_close)
      if array.get(MACD_Div_Int_arr, 29) == -1
          alert(array.get(s_arr, 29)+&quot;CrossUnder&quot;,alert.freq_once_per_bar_close)
  
  
  // end of alerts```
  </code></pre>