I have been looking at possibilities of automating trading for a while now, and the only trading platforms I've come across that have decent API interfaces are the ones from Metaquotes.
Aside from the ability to script "expert advisors",
Metatrader also has a C++ API which can be called from an external application. The original Metaquotes platform could be controlled via Windows messaging.
Another option is to look at Java-based trading platforms that communicate with the server via XML.