Artificial Stock Trading Agent
by theorangedog on Jan.14, 2008, under Skills
Thomas Helstrom created a MATLAB program entitled Artificial Stock Trading Agent, or ASTA. Unfortunately, the code is no longer available as he is turning it into a commerical product. Still, it seems that what he had was a mechanism for both creating and testing automated strategies, encompassing one ability that many modern retail platforms don’t: testing a portfolio instead of a single issue.
The program, from what I’ve read, was a collection of about 300 .m files. The paper that served as the introduction was written by Helstrom and Kenneth Holmstrom, and titled Parameter Tuning in Trading Algorithms Using ASTA. While I don’t have a copy of it available, it is included in the 1999 publication Computational Finance.
Much of the content of that paper is also included in the ASTA User Guide. The paper, followed closely, shows the methodology for the creation of the ASTA system, and it is quite an interesting read.
While there are a lot of great views and insights in the paper, one of them was interesting from a NN/AI/data-mining algorithm development aspect:
The time series formulation based on the minimized RMSE measure is not always ideal for useful predictions of financial time series. Some reasons are:
1. The fixed prediction horizon h does not reflect the way in which financial predictions are being used. The ability of a model to predict should not be evaluated at one single fixed point in the future. A big increase in a stock value 14 days into the future is as good as the same increase 15 days into the future!
2. The equation treats all predictions, small and large, as equal. This is not always appropriate. Prediction points that would never be used for actual trading (i. e. price changes too small to be interesting) may cause higher residuals at the other points of more interest, to minimize the global RMSE.
3. A small predicted change in price, followed by a large real change in the same direction, is penalized by the RMSE measure. A trader is normally happy in this case, at least if, say, the small positive prediction was large enough to give a buy signal.
4. Several papers report a poor correlation between the RMSE measure and the profit made by applying a prediction algorithm, e. g. [Leitch and Tanner 1991] and [Bengio 1997]. A strategy that separates the modeling from the decision-taking rule, such as the one in 23.4, is less optimal than modeling the decision taking directly [Moody 1992]. Arguments 2 and 3 both give some explanations to these results.
It will be interesting to see if this comes out as a commercial product or not. According to his website, the site hasn’t been updated since 2006, so I don’t really know where it is. Any insight would be great - please comment if you know.




January 15th, 2008 on 3:00 am
It would be interesting to find out if it supports multiple data streams though! Doesn’t appear obvious from the documentation, but you never know.
January 15th, 2008 on 7:07 am
Yeah - it is too bad the code is no longer available. He does say that it supports multiple stocks, instead of just one like most backtesting platforms that are available. But that is in regards to backtesting - he loads a database with historical prices for testing.
On a real-time basis I’m not too familiar with what is capable - I’m not sure if there is a limit to the data size. Still, being able to test portfolio money management rules would be interesting, as that has a crucial impact on a total system. Some platforms, that are available to the retail trader, have workaround, but they’re not that robust, and exporting the data is not particularly friendly. On that note, I’ve heard IB is good, so I may check them out, but I’m not sure how locked down they really are.
January 15th, 2008 on 12:30 pm
[...] thought this was interesting after reviewing ASTA, which seems to have capabilities of supporting both approaches. Perhaps, the solution to the [...]
January 15th, 2008 on 3:26 pm
Oh ye… I meant multiple stocks, but I keep saying “streams” confusingly. It seems pretty replicable the way it is described in the documentation and most of the indicator functions borrowed from something like this. But if they end up releasing it as a commercial product then they are deep in the money - an incentive for them to do so.
January 15th, 2008 on 3:48 pm
The user guide does seem to spell the structure out pretty well where someone with the coding ability and time could create something comparable.
Thanks for the link, too - I’ll be sure to check it out.