How do I create a signal for indicator?

 
Hi,

I have a 0 line indicator; I’d like to to produce an alert when it crosses the 0 line. How do I do this?
 
  1. If you have the code, test for a cross and issue the alert.

    double aPrev = …, aCurr = …;
    bool   wasUp = aPrev > 0,
            isUp = aCurr > 0,
           isCross = isUp != wasUp;

  2. Otherwise, create an indicator that reads it using iCustom.
              Detailed explanation of iCustom - MQL4 programming forum

Reason: