You left out very crucial details in the title you entered for this question so I have updated it to assist the rest of our viewers to discover this using the search function.
Heiken-Ashi bars are not available for alerts and scans so the solution must first compute the Heiken-Ashi close before it can be used to generate an alert.
The solution below includes a user input at the top of the code to serve as the alert level. This allows users to adjust the alert level without modifying the structure of the code. Only one signal can be used at any given time so I have included signals for both directions but marked one as a comment so it does not create an error. Simply move the "#" symbol to control which of the two signals to activate when setting up your alert.
The code itself does not know anything about the time frame. So you can apply this to any of the time frames supported by whichever tool you select: (Scan, Study Alert or Conditional Order).
input alertLevel = 150.00;
def haClose = ohlc4;
def signalAbove = haClose[1] < alertLevel and haClose > alertLevel;
def signalBelow = haClose[1] > alertLevel and haClose < alertLevel;
# use this to scan for cross above alert level
plot signal = signalAbove[1];
# use this to scan for cross below alert level
#plot signal = signalBelow[1];
The signals are set to alert only after the signal bar closes [1].