Why go through all that work when you could just use BTC-E's MT4 platform?
Actually I'm running the script inside Btc-e terminal to watch closely and other exchanges - Mtgox and Bitstamp in my case!
I've also just released the Nextcoin version of the script:
https://nextcoin.org/index.php/topic,3050.0.html