Alerts on chart and email

Help me!
I want to have the signal on chart realtime, then there will be mail sent immediately. However, I want the signal to be informed when the candle is not closed to take advantage of the good price. Or quote for a certain period of candles.
Thanks for helping me!