You will want to run your backtest with the Periodicity set to 1 minute. The functions TimeFrameCompress() and TimeFrameExpand() will allow you to create hourly bars, generate the EMA, find the cross (use the Cross() function instead of your faulty logic in the example code), and then expand the entry signal back to 1-minute bars. Give it a try and then come back if you're still struggling.
Since he always exits only using ApplyStop() with exitAtStop = true, stops are triggered inside bar as soon as price reaches desired level regardless of data periodicity. Using 1-minute data would only be needed if he had regular exits (not via stop) or entries based on 1-minute data.