Hi,
First of all you must be familiar with Lua programming language.
Probably the best place to start is.
http://www.lua.org
Here you can download a book.
Programming in Lua
by Roberto Ierusalimschy
Download and install, Our SDK Lua extension.
Editor and Debuger are included, and also an extensive Help.
http://fxcodebase.com/documentation.php
Also, Personally, I'm holding webinars on these topics.
With a focus on programming for Marketatscope / TS 2 trading platform.
Java is one of the options as well.