How to create alerts at the end of candle

How to creat alerts with scripts that is backtested and fine 

As EA seems to work live not end of candle

And "create scripted alerts" is very very buggy it just hangs and hangs

Please help...It would be great if EA is updated to give end of candle signal

Thanks

use CLOSE or give CLOSE as reference in your EA code with checks with the CLOSE of the candle for generating alerts

CAN U PLEASE EXPLAIN ON THIS. WHAT LINE I SHOULD INCORORATE ?
PL CHECK MY BUY CODE
RSI(CLOSE, 14) < 30 AND
CLOSE>SMA(CLOSE,6)

Can we get the tradescript code to generate alert on close of candle and not in between.