title: After alert condition when condition changes from true/false. Currently alerts if either condition is true. Not when it changes
body: <p>This is part of a pine script for tradingview. On the script after '//Condition', I want an alert to generate only when the condition changes from long to short or short to long. Not the end of each candle as it does now, as one condition is always true.
  This has been changed to a study.</p>
  
  <pre><code>threshold = input(title="Threshold", type=float, defval=0.0014, step=0.0001)
  
  buying  = l3_0 &gt; threshold ? true : l3_0 &lt; -threshold ? false : buying[1]
  ///// T edit
  selling = l3_0 &gt; -threshold ? true : l3_0 &lt; threshold ? false : 
  selling[1] //// T edit END
  
  hline(0, title="base line")
  bgcolor(l3_0 &gt; 0.0014 ? green : l3_0 &lt; -0.0014 ? red : gray, transp=20)
  bgcolor(buying ? green : red, transp=20)
  plot(l3_0, color=silver, style=area, transp=75)
  plot(l3_0, color=aqua, title="prediction")
  
  /////     Stragegy     
  /////////////////////////////////////////////////////
  //longCondition = buying
  //if (longCondition)
      //strategy.entry("Long", strategy.long)
  
  //shortCondition = buying != true
  //if (shortCondition)
      //strategy.entry("Short", strategy.short)
  </code></pre>
  
  <p>/////     Alerts     ///////////////////////////////////////////////////////alertcondition(condition, title, message)</p>
  
  <pre><code>//Condition
  long  = l3_0 &gt; 0.0014
  short = l3_0 &lt; -0.0014
  
  
  alertcondition(long, title = "ANN Long", message= "ANN Long")
  alertcondition(short, title = "ANN Short", message= "ANN Short")
  </code></pre>