Essentially, the exchanges do not natively have a concept of "market orders" -- filling now. Instead, some brokers implement them by selling at a penny or buying at some enormous price, essentially hitting the bid or offer. Under normal circumstances this is not a problem, as the prices are reasonable. However, during periods of extreme dislocation, when traders pull out their limit orders, all that are left are stub quotes at a penny. And because those brokers used algos that would trade at a penny, those trades happened.
You debug an algorithm like you debug any other piece of software :) I "debug" by using a regression against a pure python implementation, which was implemented in the most obvious and correct way. I discussed it here: http://veyronb.wordpress.com/2011/11/02/prototyping-with-pyt...
http://www.sec.gov/news/studies/2010/marketevents-report.pdf
I'd like the HFT traders to get into milk and apples. Maybe they can crash the price of these too so I can get some cheap groceries.
There's definitely talk of fruit futures :)
http://www.goodfruit.com/Good-Fruit-Grower/October-2011/Futu...
"The status of the long-awaited futures trading contract in apple-juice concentrate hasn’t changed. It’s still coming “soon.” "
Milk doesn't only because it's regulated (here at least).
One interesting thing about the flash crash was that the original "stock" wasn't a stock at all, but S&P e-minis, which are tied to a whole cross-section of stocks but are on an exchange that is mostly traded by pros. We have circuit-breakers now on individual stocks that halt trading if a single stock moves too much too fast, but that won't be effective if the whole index gets pushed down like it did that day.