Algorithmic Backtesting Framework for Marketcetera

For my dissertation I created a backtesting framework for Marketcetera and released it as open source. You can find the project at Sourceforge and the dissertation can be downloaded here.

Marketcetera Custom Datafeed

I haven’t been able to find a step-by-step guide that describes how to make a custom data feed for Marketcetera, so here I describe how I managed to do it. The procedure is partly based on information that I have found in forum posts and blog posts (see references at the bottom), and partly based on my own experiences. I also received a lot of help from the Marketcetera forum (especially Colin), and I can highly recommend using the forum if you run into trouble.

I used the existing Marketcetera data feed as the basis for my implementation, because I wanted to be able to connect to my own FIX server, and the Marketcetera data feed already implements a lot of the functionality I needed. If you don’t need to connect to a server but, e.g., just want to load a file with tick data, you can use the Bogus feed as the basis for your implementation.

I have done all development using Eclipse.

1. Follow the Marketceterea build instructions

(I skipped the tests during installation due to failures in some of the tests)

2. Go throught the Building Photon guide for Marketcetera (this will tell you how to build and run Marketcetera in Eclipse)

Note: It usually has to build 2 times before all build errors are gone. After the first autobuild go to (in Eclipse) Project -> Clean… and select Clean All. This will rebuild the entire solution, and should resolve all build errors.

3. Make sure that you can build and run both ORS and Photon from Eclipse.

4. Copy/paste the marketdata-marketcetera project (or the marketdata-bogus project) and give it a name of your choice e.g. marketdata-

5. Rename all the files in your project to <myFeed>…java

6. Open the MANIFEST.MF in the META-INF folder and change the ID to “org.marketcetera.modules.mdata.<myFeed>”, the Name to “<my> Marketdata Module” and the Provider to <myProvider> (or whatever you find appropriate).

7. Open the pom.xml file and change the ArtifactId to “marketdata-<myFeed>” and Name to “<myFeed> Marketdata Module”.

8. Change the IDENTIFIER field in the bottom of the FeedModuleFactory file to “<myFeed>”.

9. Expand the project org.marketcetera.photon.feature and open the feature.xml and select the Plug-ins tab.

7. In Plug-ins and Fragments add your data feed project (org.marketcetera.modules.mdata.<myFeed>).

8. In order to make the adapter available in Photon you need to modify the Eclipse Run Configuration.
In Eclipse go to Run -> Run Configurations and select Photon. Then select the Plug-ins tab and make sure your new plugin is checked.

9. Open Command Prompt (Windows) and change directory to your data feed project.

10. Run the command “mvn -DskipTests=true install”. This will build the project and generate the necessary .jar file (and skip all tests, note that you should be able to run all tests to make sure everything works as it should).

9. Rebuild the workspace and run ORS and Photon again. You should now be able to select your data feed in Photon under Edit -> Preferences -> Market Data. You should also be able to configure it by expanding Market Data and select <myFeed>.

Note that the FIX configuration file is located in your project under src/main/resources, and is called Use this for your specific FIX configurations.

You have to go through each of the files to look for error and log messages that incorporate the name of the datafeed and change it to .

The primary methods that I needed to change was toEvent(Object inData, String inHandle) in the class and is responsible for parsing FIX messages into Marketcetera events, and fireMarketDataMessage(Message refresh) in <myFeed>.java.

I hope this is useable.


Mac Screenshot in Boot Camp

On a MacBook Pro with Boot Camp 3.1 you can take screen shots with the following key combinations:

Entire screen: FN + SHIFT + F11
Active window: FN + ALT + SHIFT + F11

It might work on older Boot Camp versions as well, but I have only tested it in Boot Camp 3.1 with Windows 7.

Toggle Visual Space in Visual Studio

The short cut to Toggle Visual Space in Visual Studio is Ctrl-E+S which is really easy to accidentally do when you often use Ctrl+S to save and Ctrl-E+C to comment/uncommet a selection of lines.

So if your source code editor shows dots instead of spaces, you can use the Ctrl-E+S shortcut to once again show spaces.

Mac OS X Maximize Window Shortcut

You can easily create your own shortcuts in Mac OS X.

This example shows how to add an application shortcut to maximize the current window (the job of the green button).

  1. Go to System Preferences -> Keyboard & Mouse -> Keyboard Shortcuts -> Application Keyboard Shortcuts.
  2. Click the + button.
  3. In Menu Title enter the keyword Zoom.
  4. In Keyboard Shortcut enter some key combination you wish to use (make sure not to use a used combination).
  5. Now you can exit System Preferences and use your shortcut.

You can see a list of existing Mac OS X shortcuts at: