How to define Day High is broken

Can you please tell me how to define whether present candle’s high is greater than day high or not.

How to incorporate this logic in code form.