title: Pinescript Criteria based search and create alarm to send email
body: <p>I would like to search for multiple coins/shares based on my criteria and list them.</p>
  <p>If something new pops-up according to my criteria, I would like to send an email or telegram message.</p>
  <p>My basic idea was to compare the array size with the previous one and if the array size has changed, it means a new list for me to take action on.</p>
  <p>Thank you in advance.</p>
  <pre><code>//@version=4
  study(&quot;Searcher&quot;)
  
  var string[] ilkListe = array.new_string(0)
  string[] v1 = array.new_string(0)
  var int[] prevArray = array.new_int(0)
  int counter = 0
  
  int _oldInsideABuyOrder = 0
  
  rsiMi = rsi(close,14)
  
  sart = rsiMi &gt; 40
  
  searchConditionFunc() =&gt; sart
  
  timezone = '15'
  
  s1 = security('CIMSA', timezone, searchConditionFunc())
  s2 = security('SASA', timezone, searchConditionFunc())
  s3 = security('THYAO', timezone, searchConditionFunc())
  s4 = security('SISE', timezone, searchConditionFunc())
  
  v1 := array.new_string(0)
  if s1 
      array.push(v1, &quot;CIMSA&quot;)
  
  if s2
      array.push(v1, &quot;SASA&quot;)
  
  if s3
      array.push(v1, &quot;THYAO&quot;)
  
  if s4
      array.push(v1, &quot;SISE&quot;)
  
  src_label = ''
  src_label := s1 ? src_label + 'CIMSA\n' : src_label
  src_label := s2 ? src_label + 'SASA\n' : src_label
  src_label := s3 ? src_label + 'THYAO\n' : src_label
  src_label := s4 ? src_label + 'SISE\n' : src_label
  
  l1 = label.new(bar_index, 0,src_label,color = color.green, textcolor = color.white)
  
  _oldInsideABuyOrder := nz(array.size(v1))
  
  plotchar(nz(array.size(v1)), title=&quot;v1ArraySize&quot;, char=&quot;&quot;, location=location.top)
  
  plotchar(_oldInsideABuyOrder, title=&quot;_oldInsideABuyOrder&quot;, char=&quot;&quot;, location=location.top) 
  
  plotchar(nz(array.size(prevArray)), title=&quot;prevArray&quot;, char=&quot;&quot;, location=location.top) 
  </code></pre>