Of course your insidebar variable condition return true on each bar in 1 hour timeframe, since it test the daily timeframe values 🙂
About my code, the offset was different, for testing an inside bar, you have to test the previous day candlestick if it’s included in its previous one.
When you test the DHIGH(0), you are testing the actual day high and it changes all day long if price get higher.