need trade script for engulfing with my condition

Hi friends,I Need a trade script for the following requirtment,

previous candle high greater than previous high
previous candle low lesser than previous low
for time interval 30mins

this is like engulfing but not engulfing because its only depends high and low