theorangedog.net

Tag: Algorithmic Trading

SMS Order Confirmation

by theorangedog on Jan.24, 2008, under Skills

No posts for a few days as I have been busy working on a couple of projects, plus I’ve started studying for the CFA L2 exam. One project is relative volatility, which I’ll get to in my next post; the second is an SMS trade confirmation system. This last one has really been getting to me.

So far, I’ve been able to get the system to work as long as it is attached to a trading strategy. The code is written in EasyLanguage and therefore amateurish at best, although I did review the methods for implementing it using C++. Still, I can’t get the program to run on its own without a strategy attached. However, when it works, it is very nice: I get a text message sent to my phone in the following structure:

1035 Short 1 ESH08 at 1345.25

where 1035 is the time, in this case 10:35a exchange time.

The first response coming to anyone’s mind, I’m sure, is:

Why would you want this? And please don’t say its because you leave your computer unattended while a system runs!

Yes, I do. I constantly monitor the system and have controls as best possible in place, but at times it is unattended. As a backup, I do maintain contact via remote access, which I can connect to if necessary. Also, my computer is set with back up resources (ie power).

I will put the completed code for the messaging system up as soon as I get all of the bugs worked out. It will be featured in the Models section.

And, while I certainly don’t encourage it, if anyone else leaves moderate- to high-frequency systems unattended, I’d be interested to hear your experiences - including the horror stories.

Update: I uploaded version 1.1 of the SMS system to the Models page. The code output is dependent upon the order type, but really this version is designed for a single contract system. I will add additional versions that accommodate multiple contract/share positions as well as partial/ladder sells/buys.

Leave a Comment :, , , more...

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.

5 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Try Google.

Endurance

The best long distance runners eat raw meat, run naked, and sleep in the snow.