I've stuck the code for 50 or so popular technical indicators up on GitHub. They're written in JavaScript - they're for use on https://www.cloud9trader.com for plotting on price charts inside trading algorithms - though the code is easy to read so useful for translating to any language and building