Your choice of simulation software can have a greater impact than you may think. Most simulation platforms that are priced within reach for hobby traders and even smaller asset managers are quite frankly junk. If you start modeling in those environments, you will most likely either need to throw it all out and start over later, or accept massive error factors.
Last month I wrote about how to make sure you get solid data to work with. As I expected, it turned out to be one of the least popular articles I’ve written. Probably because it lacked my usual rants and overly opinionated attacks on technical analysis, clueless bloggers or retail trading techniques. Don’t worry. I’ll get back to ranting soon again.
So let’s assume that you’ve actually read the article last week on data, and that you have gone and bought a solid set of data to work with. Now you need software solutions.
If you don’t have a really good reason for picking some other software, I would strongly recommend RightEdge. There are two reasons for this recommendation. First, this is my own personal environment of choice. I wrote an article a while back explaining why this software is both really great and extremely cheap. The second reason is that I get a kick back if you buy it. Yep, that’s right. But only if you give them my super secret coupon code, clenow. The good news is that if you use this code, you’ll get a 10% discount, so we both come out ahead.
The short story of why I like this platform is that it’s extremely flexible. It can do what you need to get done. This is exactly the problem with almost all other reasonably priced simulation platforms. They won’t let you do anything other than what the developer had in mind. They’re not really development environments, they’re just scripting boxes.
RightEdge is based on the CLR platform, so you can code everything in C#. You could also use VB.Net if you really want, buy what would be the point of that? You build not just the simulation code in C#, but you can also make any plugins you like. Something missing in the product? Fine, build it yourself! I make new plugins all the time for reporting, visualization, simulation, data handling etc. It’s really not that difficult.
If coding scares you, then you have two choices. Get out of the systematic trading field, or pick up a programming book. No, hiring someone won’t cut it. Learn it, or find another hobby. It’s not scary and it’s not difficult.
Adapting the Data
In the last article, I wrote about my suggestions for how to structure the data in a MySql server. Of course, neither RightEdge or any other software will read straight from your MySql tables. You’ll have to construct a data adapter.
The good news is that RightEdge ships with plenty of sample code. The easiest way to learn the API for a data retrieval adapter is to open a simple one, like the Yahoo Data Retrieval sample and modify it to read from your database instead. The image below shows you where to find the samples.
And how to you open the files? Well, you need to get Microsoft Visual Studio of course. Yes, you need a compiler.
Now make a new dll. Reference RightEdge.Common and MySql.Data. Implement the IService and IBarDataRetreival interfaces. Fill in the obvious blanks in the code. And finally, use the SQL query from the last article, or something similar, to go fetch the correct, adjusted data and feed it back to RightEdge. Easy.
Remember to return properly adjusted series. If you want to go a step deeper, you may want to put a toggle in the user interface for getting total return data or regular price data.
Making a data adapter is really easy and it makes for a good exercise if you haven’t done much coding before. No, I’m not going to give you the full source code. That wouldn’t really teach you anything. Trust me, I’ve given you enough information above. From that, it’s really easy to finish the adapter.
When it’s done, compile it and copy the dll into RightEdge’s plugin folder. If all is done correctly, it will be part of the platform when you next open it.
Setting up the Adapter
Go to the tools menu in RightEdge and select Configure Services. Click new. If you made the adapter correctly and put it in the right folder, you should now see it listed. Give it a nice friendly name and add it.
Watch that List
With me so far? Then let’s set up a watch list. Make a new watch list and open its settings. Go to the Service tab as shown below and tell your watch list to use your data adapter.
Now you can add all your symbols. If you want to do it manually, just copy/paste them in. If you want to do it more properly, take a look at the file SymbolConfig.xml in the RightEdge folder under your user profile. The way I do it is to make a little program that auto populates symbols with all the correct meta data, by writing straight to the SymbolConfig.xml.
Note that if you’re doing the kind of simulations I did for Stocks on the Move, you will need to add a lot of symbols. You would need all current and past members of an index, regardless of whether those stocks still exist or not.
Once you’ve got the symbols in there, you’re ready to rock. Click the update button, shown with a red arrow above, and data will load. You should see something like the image below. If you get errors or 0 bars, you’ve got yourself a problem.
Now you should be able to get chart data. Double click one of your stocks and see. If you get the data now, you’re ready to build your trading strategy.
You see? I told you it was easy.