I see that, we all have to start somewhere though. What's good IMHO is you decided to pseudo-code it first.... good job, seriously. I also like the addition of the colon at the end of the if statement; gives it an air of professionalism. I prefer curly brackets myself but I expect Python is the language you'll be using. Good luck!
There may be old threads about Pair Trading on ET that delved into notification for shorter timeframes. But these threads are pretty old involving Bright Trading, etc. so some of the technology suggestion may be outdated.