Tuesday, November 29, 2005

Bit Of A (Long) Status Report

If you read through some of the blog entries here, you'd know that I'm making some software to help me out with my trading. I wanted to come up with trading rules that were purely objective - so mechanical that a computer could do it. And then I decided that if a computer could do it, then a computer should do it. You can read here my thoughts on the advantages and disadvantages of automated trading.

And I thought that I should make it as easy as possible for me to create and edit systems, so as to make experimentation incredibly simple. That meant no coding of systems! None. Just selecting rules from pull-down lists. It takes about 5 or 6 mouse clicks to add a new rule to a system, about 3 or 4 to edit its parameters, and about 2 to remove.

Turned out to be quite a bit involved with making an automated trading-bot. Who would have thought? :-) So it's taken quite some time.

And then I decided that other people might like to benefit from my hard work and use my software as well, in that tried-and-tested fee-for-service kind of way.

So, for anyone interested, if there is anyone, I wanted to clarify when the software might be available, and what it will and will not do when you get your hands on a copy. What's written here takes precedence over anything else you may have read on this site.

Here are the tasks remaining:

Tasks remaining

Unfortunately the thing with software development is that an hour worked doesn't necessarily amount to the same amount of work being completed. Some of the tasks in that chart will take 2 days, and some will take 2 hours. Sometimes completing a 2 day task will leave me with several 2 hour tasks, thus actually making the chart of tasks look worse than it really is. So it's not the best of tracking methodologies, but it's just me working on this - it's not like I have a large team of developers. Or a budget.

Anyway, as that straight line I drew suggests, I'm hoping to have something ready by Christmas. A nice present to myself after many months of hard work.

I've split the functionality out into modules, so here's what it does described in a modular-type way:

Brokers
There are a few brokers that provide APIs (interfaces for software to make trades on their platforms). And here's the funny, funny thing - each and every one utilises a different technology in order to get the job done. Oanda provides a DLL, Gain Capital utilise webservices, Interactive Brokers provides an OCX.

The Gain Capital interface will be done first, as they provide the API free. This will be complete on the initial release.

After the initial release, I will get on to finishing the interface for Interactive Brokers and Oanda. Interactive Brokers seem to also allow trading in things other than just currency. And I think Oanda has the best setup in terms of the API and their spread, but their API is also the most expensive at $600 up front.

I'm guessing the normal course of events would be for someone to try out my software using a Gain Capital demo account, and then if they like it and want to use Oanda, then they pay the $600 to Oanda for the use of their API.

Opening an account with Gain Capital is quite straightforward - an online form and then a couple of things to print and fax to them if you are not a resident of the United States.

After those three are done, I will go about coding the interfaces to any other broker that provides an API.


Data
In the initial release the companies that can used for downloading price data will obviously be restricted to Gain Capital. Aside from the free API, the other good thing about Gain Capital is that they provide tick data going back many years, available for free from their website. And of course Thinking Stuff provides the ability to load the data from those files into the database.

There are one or two abnormalities in some of the files, but I will provide clean versions of those particular files.

You set what price data you want to download (which currencies, which time intervals - 5 minutes, hourly, daily, etc). And you can also specify what price data you want Thinking Stuff to create.

For example, you set that you want to download tick data from Gain Capital. You then specify that you want Thinking Stuff to create 5 minute interval data, hourly, and daily bars from the tick data. Or maybe you create the hourly data from the 5 minute, and the daily from the hourly. Up to you.

Example #2, you want to trade using 4 hour interval data, but Gain Capital doesn't provide that data (for example). So, you specify that you want to download the hourly bars from Gain Capital, and you get Thinking Stuff to create the 4 hour interval data from the hourly data that you downloaded.

Your account information and transactions (for those companies that provide transactions) can also be downloaded at regular intervals that you specify.

Access To Data
Thinking Stuff allows you to save the data to text files.

You also have *complete access* to the database. Hey, it's your data. (Just please please please don't change any of the settings that Thinking Stuff needs to run. I'll explain more about the database tables closer to/after the initial release).

Essentially Thinking Stuff runs on a client/server model, but your computer is both the client and the server.


Systems
As mentioned about 100 times or so, you create your systems by clicks of the mouse.

For both long and short, these are the settings:
  • Entry Rules - all rules must be met in order for an entry to take place.

  • Entry Values - if all Entry Rules are satisfied, will set the entry at this level.

  • Initial Stop Loss Values - if all Entry Rules are satisfied, will set the initial stop loss at this level. Without an initial stop loss, no trades will be entered.

  • Initial Take Profit Values - if all Entry Rules are satisfied, will set the initial take profit at this level.

  • Move To Break Even Rules - all rules must be met in order for the stop loss to be moved to a position of break even.

  • Stop Loss Management Rules - all rules must be met in order for the stop loss to be moved.

  • Stop Loss Management Values - if all Stop Loss Management Rules are satisfied, will move the stop loss to this level.

  • Take Profit Management Rules - all rules must be met in order for the take profit to be moved.

  • Take Profit Managmenet Values - if all Take Profit Management Rules are satisfied, will move the take profit to this level.
There are also secondary Stop Loss Management Rules and Values, and secondary Take Profit Management Rules and Values.

You don't need to use all of those - in fact you can consider a system with only Entry Rules, Entry Values, Initial Stop Loss Values, and Initial Take Profit Values as being "complete".

This is where you really need to be careful and think about what you have set up. Looking at the results of the backtests should hopefully let you know if your system has all the parts it needs to properly buy and sell at the times you want it to.


Backtesting
Select the system(s) to backtest, select the currency(ies) to backtest them on, select the dates to test over. Click start.

The dates you select are for the lowest interval. Thinking Stuff works out what data it needs for the other intervals.

For example, you have a system which runs off hourly bars. But you also have a rule in there that checks a condition based on the daily bars (yes, you can create systems with multiple time-frames). You select the dates on the backtesting window that the hourly will run on, and Thinking Stuff works out how much daily data it needs.

Unfortunately the initial release will provide the results in a comma-seperated file, which opens in Excel. I say unfortunately because it's not the prettiest of beasts. The thing to remember though, is that even if I pretty it up, it's still just the same information.

The file contains all the rules that make up your system, so that if you modify the system later you will now what was actually tested.

Then the summary, then details of each trade.

You also have the option of creating a data file, which will print out the data it used for the backtesting, along with the indicator data. I have an Excel macro which makes a chart so you can see exactly where the system bought and sold and moved its stop loss, etc.


Auto-Trading
Create your system, attach an account to it. Move it from an "Available" trading system to an "Active" one. That's it.

To turn a system off, move it to the "Trade Management Only" section. When no more trades are open, it will revert to an "Available" system.


Alerts
Alerts based on if a system is placing an order, cancelling an order, entering a trade, exiting a trade. All or some or none.

Alerts based on the price reaching a certain level. Alerts based on indicators reaching a certain level. Alerts based on bar formations.


Money
I subscribe to the ideas laid out in the book called The Science of Getting Rich. I must therefore give to you more in use value, then you give me in cash value.

If you think the following rates are excessive - too expensive, or too cheap, please leave a comment. All dollar amounts are in U.S. currency.

Downloading data is free.
Backtesting is $200 per year.
Auto-trading is $30 per month.
Alerts are $30 per month.

You have complete access and control over the database in which Thinking Stuff puts the data, and as mentioned, downloading the data is free. If you can code, you might want to use Thinking Stuff to download the data, then make your own program to do the backtesting.

That's what I would do. If... I hadn't just spent more than a year creating this software. A lot of my spare time went into this. Too much of it.

You should ask yourself what your time is worth? If it's $10 per hour, you have just 20 hours in which to create something equal to what I offer. After that, you're actually losing money just because you know how to code and don't want to pay for someone else's program. Up to you. Personally I think my spare time is worth a lot more than $10 per hour.

And I have an offer for budding programmers. If you create something which utilises or is compatible with the Thinking Stuff database, I'm happy to incorporate it into my software. Either I'll buy the code from you outright, or we can agree to some large percentage of the proceeds from that particular functionality headed your way. Please use Visual Studio .NET.

More life to all.


Things that might possibly get added in the future
I'm not promising these things will get done, so you're better off assuming you never read this paragraph. However, if you really really really think something is a fantastic idea, please don't be shy in telling me so.
  • Translate a trading system into TradeStations's EasyLanguage, WealthLab's WealthScript, MQL4, etc.

  • Allow comparison between indicators. For example, Simple Moving Average with period 5 is above Upper Bollinger Line with period 20.

  • More Equity Curve Analysis rules (research also required).

  • Handle stocks, futures, etc. Not just currency.

  • Yahoo! Finance as a data company.

  • Allow user to select the time zone to display dates in. Currently all GMT.

  • Save user settings.

  • Pip-by-pip backtesting. This would allow holidays to be incorporated into backtesting, allow backtesting of scalping techniques, and remove some of the assumptions that must be made when backtesting using interval data. Would be slow though.

  • Incorporate support and resistance lines into backtesting. User would specify where the lines should be placed, from when they start being used in calculations, and when they stop being effective.

  • Optimisation functionality.

  • "Time of day" rules - to allow entering and exiting at particular times of the day.

  • Can pause/restart trading by sending an email with particular words/password to an email account.

Finally, I wanted to say that while the software is called "Thinking Stuff", it will in fact do exactly as you tell it. Nothing more. It is a useful tool, it might give you an edge over people that don't have it, but having it does not guarantee any kind of financial windfall. You still have to come up with the strategies by yourself. Or you could buy a system from somebody... Now that you have the means to test it out to see how good it actually is... :-)

Of course, the best way to tell if this is for you or not, is to trial it yourself. I'll get cracking.

Questions/comments/suggestions are most welcome.

2 Comments:

TraderEyal said...

Sounds cool. On pricing I would recommend offering a monthly, quarterly and yearly options as well as a package deal for the full backtesting/downloading/auto-trading.

Wed Nov 30, 04:25:04 PM EST  
Sharky said...

Good point. There a lot of combinations and permutations though. It's a balancing act between giving people who buy more stuff more benefits, and keeping everything nice and simple.

I was thinking about giving people extended subscriptions rather than having differing price schedules. Like buy 10 months of auto-trading and get 2 free, or something like that.

In the end the result is the same. But the amount being paid by someone is consistent, and the amount I'm receiving is consistent. All I have to do is change the date their subscription expires.

I dunno - maybe both approaches work out the same in the end.

I was also thinking of giving extra days to people who find and report a new bug (which has not already been reported), with the number of days going up with the severity of the bug found.

What do you think?

Thu Dec 01, 11:20:06 AM EST  

Post a Comment

<< Home