Avoid Gap Up entry

How do I avoid it taking position during a scenario of gap up? For example, If I want to enter when the close crosses above 500. But this entry can also trigger when there is a Gap up. How to avoid that?