Michael J Bommarito II's blog
Paper: A Profitable Trading and Risk Management Strategy Despite Transaction Cost
Readers might be interested in an article that A. Duran and I have coming out in Quantitative Finance this year entitled A Profitable Trading and Risk Management Strategy Despite Transaction Cost. In the article, a number of the tools I've presented on the blog here have been used in the development of strategy which outperforms the S&P500 in rigorous out-of-sample testing. We've made sure to check the robustness of the results, and have performed Monte Carlo simulations while varying the sets of stocks and time periods used in the calculation.
While you're waiting for its publication in Quantitative Finance, you might check out the abstract over at SSRN.
- Add new comment
- 407 reads
Visualizing Bank Failures, 2008 - 2009
As detailed on my Computational Legal Studies blog, coauthored with Daniel Katz, the following video shows a dynamic visualization of bank failures over the past two years.
Read more here
Visualizing Bank Failures ( 2008-2009 ) from Michael J Bommarito II on Vimeo.
- Add new comment
- 2617 reads
Cash for Clunkers – Visualization and Analysis
As detailed on my Computational Legal Studies blog, coauthored with Daniel Katz, the following video shows a dynamic visualization of the Cash for Clunkers program:
Read the full post here.
- Add new comment
- 806 reads
Visualizing the Campaign Contributions to the United States Senators in the 110th Congress — The TARP EDITION: The Image
As detailed in this post, here is the visualization of contributions to the members of the 110th Congress. Highlighted in green are the recipients of the TARP.
To view the full image, please click here.
![]()
By Michael Bommarito and Daniel Martin Katz.
Center for the Study of Complex Systems and Department of Political Science, University of Michigan, Ann Arbor.
- 1 comment
- 2858 reads
"Fannie Mae Eases Credit To Aid Mortgage Lending" circa 1999, NY Times
http://query.nytimes.com/gst/fullpage.html?res=9C0DE7DB153EF933A0575AC0A96F958260&sec=&spon=&partner=permalink&exprod=permalink
Paragraph 8:
"''From the perspective of many people, including me, this is another thrift industry growing up around us,'' said Peter Wallison a resident fellow at the American Enterprise Institute. ''If they fail, the government will have to step up and bail them out the way it stepped up and bailed out the thrift industry.''"
- 1 comment
- 3073 reads
Comparison of ETFs and CEFs: Dollars Traded Per Day vs Total Assets
This picture should be pretty straightforward. The numbers are the natural log of the average dollars traded per day YTD and the natural log of total assets held. Note the distinct clustering of the two asset types.

- Add new comment
- 3753 reads
Using Matlab's Database Toolbox with MySQL Connector/J
I normally don't delve too much into the programmatic details of my work, but I've seen enough interest in this topic that I figured I'd lend a helping hand to those fellow frustrated souls.
There are a few awkward, non-native MEX implementations of various database interfaces. However, Matlab has its own database toolbox built around ODBC/JDBC, and when developing distributable software, one always hopes to minimize third-party library usage. As a result, I've put a good deal of effort into integrating Matlab with both MySQL and SQLite. In fact, the data for every post on this site is stored in a 2GB MySQL database server running on my laptop.
As you can see, this requires only that you distribute the platform-independent JAR. No DLLs, no MEX compilation.
% Database Server
host = 'localhost';% Database Username/Password
user = 'user';
password = 'password';
% Database NamedbName = 'assets';% JDBC Parameters
jdbcString = sprintf('jdbc:mysql://%s/%s', host, dbName);
jdbcDriver = 'com.mysql.jdbc.Driver';% Set this to the path to your MySQL Connector/J JARjavaaddpath('mysql-connector-java-5.1.6-bin.jar')% Create the database connection object
dbConn = database(dbName, user , password, jdbcDriver, jdbcString);% Check to make sure that we successfully connected
if isconnection(dbConn)
% Fetch the symbol, market cap, and last close for the 10 largest
% market cap ETFs
result = get(fetch(exec(dbConn, 'SELECT info.symbol,info.marketcap,series.close FROM info, series WHERE info.type=''ETF'' AND info.id = series.symbolid AND series.date = ''2008-04-11'' ORDER BY marketcap DESC LIMIT 10')), 'Data');
disp(result);% If the connection failed, print the error message
else
disp(sprintf('Connection failed: %s', dbConn.Message));
end
% Close the connection so we don't run out of MySQL threads
close(dbConn);
Output:
'SPY' [8.2300e+010] [133.3800]
'EFA' [4.5420e+010] [ 72.6400]
'EEM' [2.3850e+010] [139.3400]
'GLD' [1.9260e+010] [ 91.3000]
'QQQQ' [1.7040e+010] [ 44.2800]
'IVV' [1.6410e+010] [133.5200]
'IWF' [1.2860e+010] [ 55.2500]
'DIA' [1.0830e+010] [123.3400]
'IWM' [1.0470e+010] [ 68.7200]
'VTI' [9.7800e+009] [132.2900]
- 12 comments
- 12509 reads
Marketocracy ETF Portfolio: April 12, 2008
Marketocracy, in their own words, is:
"""Marketocracy Data Services is a research company whose mission is to find the best investors in the world and then track, analyze, and evaluate their trading activity. The company's affiliate, Marketocracy Capital Management, is the investment advisor for the Marketocracy family of mutual funds and uses the research generated by Marketocracy Data Services."""
This isn't an endorsement for Marketocracy, but last October, I started a portfolio there as part of the activities for a club here at the University of Michigan. While I'd originally intended it to be allocated strictly from the Select Sector SPDR ETFs, Marketocracy rules led me to increase the scope of the fund to include commodities, currencies, and geography-based ETFs.
You can view the portfolio performance at this link: www.marketocracy.com/cgi-bin/WebObjects/Portfolio.woa/ps/FundPublicPage/source=DeDoDkLbEhAdLcIhMaKiAbDd

| RETURNS | S&P500 RETURNS | RETURNS VS S&P500 | |
|---|---|---|---|
| Last Week | -1.80% | -2.69% | 0.88% |
| Last Month | 3.36% | 1.98% | 1.39% |
| Last 3 Months | 0.42% | -4.36% | 4.78% |
| Last 6 Months | -2.34% | -13.76% | 11.42% |
| Last 12 Months | N/A | N/A | N/A |
| Last 2 Years | N/A | N/A | N/A |
| Last 3 Years | N/A | N/A | N/A |
| Last 5 Years | N/A | N/A | N/A |
| Since Inception | -1.63% | -12.48% | 10.85% |
| (Annualized) | -3.08% | -22.38% | 19.31% |
My largest positions at the moment are DUG @ 14%, SHV @ 11%, UPW @ 7%, and EWA @ 5%. I doubled my exposure in DUG, the double short Oil & Gas fund, this week as it hit a new 52-week low, despite downgrades in both the funds' constitutents and projected consumption. I'll be looking to lighten the position in the short-term treasuries SHV in the coming month for bottom plays, possibly in the double long financials ETF UYG or some mixture of country ETFs.
- Add new comment
- 3919 reads

Recent comments
13 weeks 3 days ago
18 weeks 2 days ago
22 weeks 1 day ago
27 weeks 6 days ago
32 weeks 2 days ago
42 weeks 1 day ago
43 weeks 2 days ago
51 weeks 1 day ago
1 year 5 weeks ago
1 year 23 weeks ago