Inside bar code

High is lower than previous candle high Low is higher than previous candle high Basically I am searching for a inside bar. How to code this?

http://tradingqna.com/55126/inside-bar-candlestick