Archive

Archive for the ‘dereferenced’ Category

Kooderive

February 3rd, 2010
photo by Simon Rogerson

photo by Simon Rogerson

Some time back, I’d written about NVidia’s CUDA noting that it looked ideal for many asset-pricing and monte-carlo type problems in finance.  At the time, I was hopeful that it would be quickly integrated into existing open source efforts like QuantLib, but adoption has proved slower than I’d hoped, most likely because implementing non-trivial problems on CUDA is, well, even less trivial than doing them without..

LMM on CUDA

Happily, I’ve just seen a promising first step in this direction as Über-quant and C++ artisan Mark Joshi recently announced an open-source project, Kooderive which looks to implement the LIBOR Market Model (LMM)  on top of CUDA.  His announcement on the QuantLib mailing lists reads:

Dear All,

various people have shown interest in the use of CUDA with QuantLib. I
have now made some progress on a CUDA implementation of the LIBOR
market model
.

In particular, I now have a path generator for the LMM working which
does 16384 paths for 40 rates, 40 steps, 5 factor model, displaced
diffusion predictor-corrector that takes 0.1 seconds on my Quadro 4600.

The state of the project is code fragments that can be called from
other code. Those who are interested can get the code via
the subversion repository on kooderive.sourceforge.net .  The only
project file is currently for VC9 x64. It also uses thrust and the
CUDA SDK.

The next stage will be writing routines, that use QuantLib for the CPU
stuff and kooderive for the GPU stuff,  to actually price things.

A gentle reminder that I will be giving a course on the LMM and
QuantLib in June in London, and I will include a session on kooderive
if there
is sufficient interest.

I am happy to take code contributions for kooderive. However, I am not
looking for a redesign of the library or contributions which introduce
dependence on other libraries. I am interested in contributions of
separate routines and of optimizations of existing routines that do
not change interfaces.

regards

Mark

Pricing exotic interest rate derivatives – The LIBOR Market Model in
QuantLib June 2010, London,
http://www.moneyscience.com/training/index.html

Assoc Prof Mark Joshi
Centre for Actuarial Studies
University of Melbourne
My website is www.markjoshi.com


EMS Internals, dereferenced, monte-carlo methods, open-source software, options pricing, technology

“the SEC made Madoff”

January 17th, 2010

Bill Harts, a friend of mine who has, as they say, forgotten more about electronic trading and market structure than most will ever be burdened by, has recently taken an interest in the public letters written to the SEC in response to their requests for public comments on dark pools.  Mostly, these letters are funny and reveal people’s propensity to point shoot and aim in that untidy order.

But some are revealing and one in particular is 100% required reading for anyone interested in electronic markets.

The writer introduces himself thusly:

I am Steve Wunsch, the principal inventor of two SEC‐regulated stock exchanges, the Arizona Stock Exchange “AZX” (originally called Wunsch Auction Systems, Inc. “WASI”) and the ISE Stock Exchange, both of which include dark pools. In fact, both of them, like all modern stock exchanges, have both lit and dark components and, thus, have provided me with potentially useful perspective on the dark pool question and on transparency in general. I will focus heavily on the latter, for it is impossible to understand the dark pool issues raised without understanding the value of transparency or, if improperly applied, the lack thereof. The AZX experience was, I believe, particularly instructive in this regard. Its highly transparent call market structure, combined with its unique regulatory status as a “low volume exempt”exchange, enabled me to see transparency and the role of regulation in promoting it from a perspective that I don’t believe anyone else has.

He deftly mixes snark and a historical perspective on regulation with an opinionated and informed view on the forces driving current equity markets’ microstructure arguing that the worst issues are due to regulatory failures.  He concludes, logically enough, that the SEC should be disbanded.  Perhaps his most inflammatory bit is his claim that the “SEC made Madoff.”  For effect, the section is entitled “An American Oligarchy”:

AN AMERICAN OLIGARCHY

It is not in the Commission’s interest to admit failures of policy, such as the ones I have described in this letter, and I have never seen it done. It was not in the Commission’s interest to admit that Bernie Madoff was the SEC’s most trusted and intimate confidante in formulating and selling transparency, electronic trading and
the whole NMS concept to Wall Street, the public and Congress. His legitimate business was the epitome of the kind of transparent electronic competition that NMS’s leveling policies were trying to create, and he occupied the most favored place of all industry advisors on policy and rules as NMS was being created. In a very real and literal sense, Madoff’s legitimate business and NMS were made for each other. NMS cleared a path for the application of continuous transparency by new electronic competitors, very visibly led by Madoff, enabling him to become at one time the third largest market in the United States, even though he wasn’t officially registered as anything but a broker‐dealer.

Had the SEC not emasculated the rules by which the NYSE controlled its members, Madoff would never have happened. In the time before NMS, when the exchange had Rule 390 or the stronger Rule 394 before it, diverting orders away from the floor or selling them to Madoff would have been banned. But on antitrust principles, the SEC wanted to foster NYSE‐busting competition in NMS, and Madoff became its PosterBoy for such competition. In order to make way for him, the SEC opened up a variety of loopholes that allowed orders to be diverted from NYSE to Madoff and printed on regionals like Cincinnati. Rules 19c‐1, 19c‐2 and 19c‐3 were in this vein. There were perennial attempts by the NYSE to plug the loopholes and rein in the membership, but the SEC batted them all away, enabling Madoff to continually grow his business. Eventually, the NMS environment forced the NYSE to abandon Rule 394, then Rule 390 and ultimately its membership organization altogether when it demutualized. This was all very good for Madoff. And Madoff was very good for NMS, giving it industry cred far in excess of what this poorly articulated socialist leveling theory could have had without his support.

In spite of a 457‐page SEC investigation into Madoff and how his Ponzi scheme was missed, the most obvious reasons were not considered, namely, that Madoff played a central role in helping the Commission design and sell NMS, and that NMS made him rich long before the Ponzi scheme. Most importantly, the credibility that theCommission’s collaboration with Madoff on NMS conferred on him was the principal factor enabling him to bring in money for the Ponzi scheme. Although the investigation’s report notes his credibility in the industry, it is mentioned as if itwere just a fact of life and was already there. Not mentioned is that his superior access to the SEC and apparent influence over the Commission, both of which were implicitly proved by his ability to get rich on NMS, are the most important reasons that he had such extraordinary credibility in the industry. The truth is that the SEC made Madoff. He could not have existed as a threat to investors without the Commission’s active and dedicated support over several decades.

Although, in typical blogger fashion, I’ve highlighted his spiciest claim, the rest of the letter is more technical and informative while just as entertaining.  I encourage you to read it and then engage in a thought experiment in which You are the designer of an electronic exchange and must balance the needs of a very heterogeneous set of users and stakeholders while ensuring transparency, liquidity, profitability, “fairness”, performance (he references an exchange targeting 100M executions per second) and utterly fail-safe transactional integrity…

I have embedded the full letter below the break…

Read more…

dereferenced, our managed markets

core arb

December 15th, 2009
core arbitrage?

FIX interface?

Cloud computing looks to have turned yet another interesting corner.   This time the turn leads towards the development of a liquid, fully electronic new marketplace in “spot instances”.

Spot‘ means what you would expect it to in the context of trading: the current pricing for immediate delivery of a commodity.  ‘Instance‘ is the atomic element within Amazon’s cloud environment; an instance is the smallest chunk of computing capability which can be provisioned within the cloud.

Amazon is making markets in cores and they’re exposing functionality just as a regular exchange would: both through user interface ’screens’ as well as programmable APIs.

From their announcement:

Spot Instances enable you to bid for unused Amazon EC2 capacity. Instances are charged the Spot Price set by Amazon EC2, which fluctuates periodically depending on the supply of and demand for Spot Instance capacity. To use Spot Instances, you place a Spot Instance request, specifying the instance type, the region desired, the number of Spot Instances you want to run, and the maximum price you are willing to pay per instance hour. To determine how that maximum price compares to past Spot Prices, the Spot Price history is available via the Amazon EC2 API and the AWS Management Console. If your maximum price bid exceeds the current Spot Price, your request is fulfilled and your instances will run until either you choose to terminate them or the Spot Price increases above your maximum price (whichever is sooner).

embedded optionality

While the inclusion of, effectively, a market data service is neat, probably the most interesting aspect of the initial protocol they’ve designed is that it contains embedded optionality and behaves a bit like barrier options.  That is, when I setup an ‘order’, I need specify a maximum price I’m willing to pay.  When the spot price drops below my max, I get “knocked-into” a contract and instances are allocated to me.  If the spot price rises above my max while I’m running, I get “knocked-out” of the contract and my jobs get terminated.

The intent is to allow for low-priority jobs to be dynamically run whenever pricing drops below a user’s threshold, but the (intended?) consequence is that it adds the delicious and malleable tang of path dependency to these instruments…

secondary markets, FIX, arbitrage..?

Amazon currently controls the market entirely, but it’s not hard to imagine a secondary market evolving.  Given that others are beginning to copy Amazon’s APIs, one can also imagine markets which operate across providers …  perhaps accessed via FIX?…

Who knows?  In the not-too-distant future, we may well be able to implement ‘core arb‘ strategies…or make markets in cores… or find that we can effectively hedge with disciplined exposure to the ‘core market’ or …

FIX Protocol, dereferenced, technology

peaky

December 8th, 2009
messages per second across all feeds

messages per second across "all" feeds

I came across this compelling site which uses a hardware-based ticker plant (Exegy) in a colo environment to measure peak bandwidth across scads of NA feeds and then, every minute, updates a chart like the above to capture the average messages/sec across all of them.  Pretty swank.

While the uninformed may rail against colocation rather than focus on less intriguing issues like banana-variety corruption, they miss the basic point that colo can be done by anyone with the checkbook and the wish to do so.

unfair advantage?

unfair advantage?

It’s sort of like that boat in Forrest Gump.  Forrest wanted to be a shrimper.  So he invested in a boat.  With his initial capital, hard work, perseverance and a bit of luck, Forrest made a go of it.  He might easily have not made it. Colo is like that.  You can shrimp without a boat if you have a mask and fins, but it’s likely not a sustainable model… either way, it’s hard to see the harm in Gump’s boat.  Or colocation.

Hat-tip to Rodrick’s Web Log !! for spotting the market data peaks site.

dereferenced, market data, our managed markets

perfect crime

November 2nd, 2009

or: a computational complexity model for derivatives fraud

lemon law arbitrage?

lemon-law arbitrage?

Derivatives pricing has always been a notoriously complex, computationally expensive and potentially breathtakingly remunerative undertaking.  This is true enough for relatively vanilla, exchange-traded options, but once one goes off-market and starts applying creative financial engineering, it can get much more complicated.  Products like CDOs, CDSs, CDO^2s and their ilk have exploded in recent years creating opaque markets of trillions of notional dollars and accounting complexities we’re still only beginning to understand.

A recent paper, Computational Complexity and Information Asymmetry in Financial Products, by Arora, Barak, Brunnermeier and Ge take things a step or two further as they illustrate using information theory that it may be far worse than imagined as totally undetectable fraud can be engineered into these products.  They show that fraud with these products can be undetectable in the sense that the pricing process is a formally intractable problem when the informational asymmetry inherent in the development of these products is taken into consideration. In this context, “informational asymmetry” is a polite way of saying “fraud.”

The authors, from the Department of Computer Science and Center for Computational Intractability at Princeton (man, I want one of their business cards!), demonstrate that if the designer of, say, a CDO wants to cherry-pick amongst bundled assets to maximize their own return, they can do so in a way such that it would be impossible for a buyer of the derivative to know they were being stiffed.  The problem can be so hard that if you got the NSA’s mythic clusters humming on a pricing model, they might chug away until the sun falls from the sky before they accurately price it…  Co-author Rong Ge provides a FAQ to the paper here and I must hat-tip Andrew Appel for his informative post on the paper.

The “perfect crime” is a puzzle that has occupied the (criminal and otherwise) mind of many a bright and motivated soul from time immemorial.  While some may indulge towards the vulgar or base through violence or vice and others might ponder the perfect crime of passion, the cerebral Queen of Crime is surely some form of regulatory arbitrage: committing the crime for which the law has yet to be written or creatively engineering a legal loophole for a crime one has perpetrated or is about to perpetrate.  The developers of CDOs are to be lauded as it appears they have materially upped the state-of-the-art of the perfect crime.

hmmm… Is there a Nobel for that?

dereferenced, options pricing, our managed markets

easy money

October 27th, 2009

you, hf-trading

There seems to be a developing meme out there suggesting that algorithmic-, and in particular high-frequency, trading is some kind of gold-rush route to easy money which brings to mind…

…this revision of a paper I’d read previously: “Statistical Arbitrage in the US Equities Market” by Avellaneda and Lee.   It’s a detailed and thoroughly worked (and now re-worked) paper illustrating the development and analysis of a US equity stat-arb strategy based on Principal Component Analysis (PCA) and then revised to use ETFs.

I came across this paper as I have still never used PCA in any of my own strategy development work and read Carol Alexander’s excellent Market Models over my summer vacation with an eye towards giving a PCA hedging model a spin in the near-term. Thus, I wanted another look at this paper as a reference point.  Although it’s an excellent paper, I’m not going to urge you to go out and read it immediately unless you have a reasonably pressing practical interest.  Instead, I find it interesting largely because of one of its authors – Professor Avellaneda – and its conclusions in the form of its strategies’ performance.

I’ve seen Prof Avellaneda speak a number of times at a variety of quant meetups organized by the relevant Columbia/NYU financial engineering depts.  His paper reminds me that at least once during my noisome adolescent years, my father intoned darkly that:

the streets are littered with brilliant minds

Read more…

books, dereferenced, strategy development, technology

multi-strategy trading with regimes

September 13th, 2009

One of the challenges of algorithmic trading is that although there’s plenty of interest in the space, practitioners aren’t generally forthcoming about their observations.  Academics, instead, focus on things that are frequently not very immediately practicable, or when they might be, always seem to set-up a little hedge-fund on the side while publishing colorful chum about how markets are ‘behavioural’ or somesuch.

Even if it’s hard to find good stuff, one must still look as there’s always more information that can help you than you can effectively process or retain.  A few weeks ago I was trying to formalize the expected profit function of an algorithm I’m developing and wanted to see what people had written about the topic.  I entered ‘define profit function for trading algo’ into google and was pleasantly surprised to see a paper entitled ‘Multi-strategy trading utilizing market regimes’ by Mlnarik, Ramamoorthy and Savani.  It doesn’t directly cover the topic I was looking for, but instead addresses a number of related topics I’ve been interested in for some time:

  • the treatment of a strategy as an instrument in its own right
  • composing portfolios comprised of strategies
  • using regime switching techniques to manage portfolios of strategies

In this post, I’ll briefly review their paper, illustrate how one can easily model strategies in relevant ways using the strategy ‘object model’ I’ve described previously through an example, and conclude with some thoughts on how these kinds of strategies might be implemented and further explored.

Read more…

EMS Internals, dereferenced, portfolio management, regime-switching, strategy development

real battlebots

August 17th, 2009

wedding party popper

There’s been a lot of attention focused on  trading battlebots recently.  It’s important to keep in mind that this is part of a long-standing, broad and arguably inexorable trend that is now spreading rapidly away from its successful base in industrial manufacturing to every other conceivable field from scheduling and logistics, to CAD and on to more aggressive pursuits like trading and battlefield operations.  Perhaps looking at the state of the art in related fields can inform us about the direction of our algo bots.

This article in Foreign Policy illustrates an area where automation is making great strides into historically human undertakings.  The use of so-called drone aircraft for recon and tactical missile strikes has reached a remarkable milestone: this year, the US Air Force will train more “pilots” for unmanned aircraft than for real fighters or bombers.  Evidently there’s good reason for this change:

By 2013, software and communications improvements will allow the Air Force’s unmanned-aircraft pilots to simultaneously fly three drones at one time, and four in an emergency. Another factor supporting the likely proliferation of drones such as the Predator, Reaper, and Global Hawk is their low cost compared with new manned aircraft such as the F-35 Joint Strike Fighter.

According to the Government Accountability Office, $24.5 million will purchase a set of four MQ-9 Reaper hunter-killer drones plus a ground station and satellite relay. (See page 117 of this report.) The latest guess of the price for a single F-35 fighter-bomber is $100 million. (See page 93.) This gap in cost led Defense Secretary Robert Gates to demand the cancellation of the manned F-22 Raptor program in order to fund the purchase of more drones for service in Afghanistan and Iraq.

Read more…

dereferenced, technology

it’s not about microstructure

August 7th, 2009

Steal a little and they call you “thief”… Steal a lot and they call you “King” – Bob Dylan

I try to avoid the news during the trading day.  I never trade manually and as I’ve mentioned before, I’ve never yet had much success trading the news and none of our models presently use news feeds for decision-making.  So I really try to avoid keeping excessively abreast of the news as it’s just a distraction from real work.

would-be king

would-be king

That said, this morning I noted a pretty good jump in our pre-market p&l and wanted to see what splendid news had prompted the spike.  So I scanned some headlines.

On Bloomberg I saw:

U.S. Payroll Cuts Slow, Jobless Rate Unexpectedly Falls as Recession Eases

AIG Reports First Profit in Seven Quarters After Investment Losses Shrink

Dollar Advances as U.S. Employers Cut Fewer Jobs Than Economists Estimated

Unemployment down?  AIG profitable?  Dollar rumbling to strength?  Splendid, splendid and splendid.

I also saw the bit about Hank Greenberg paying the SEC $15M as he “thought it would be good to get it behind us.”  Indeed, good thinking.

And anyone looking at the news this week knows that regulators are likely going to put the kabosh on flash orders and that Goldman trades profitably.  (And they improve!)

now thats a fat tail...

my kind of fat tail

Read more…

dereferenced, our managed markets

doubling down with levered ETFs

April 22nd, 2009

This weekend I read Jason Zweig’s “Will leveraged ETFs Put Cracks in Market Close?” which references a paper by Minder Cheng and Ananth Madhaven at Barclay’s.   I tried, but couldn’t find their original paper over the weekend.  As luck would have it from across the internets Paul Kedrosky came to the rescue with a post referencing that paper, “The Dynamics of Leveraged and Inverse Exchange-Traded Funds“.

If you have any interest in ETFs, then you should read this paper carefully as it provides a very nice and accessible mathematical treatment of leveraged and inverse ETFs.

I’ve had success using ETFs in portfolio-oriented strategies to conveniently provide specific exposures, eg, to emerging markets.  I’ve also explored strategies that pit ETFs against futures and similar arbs that take advantage of contract rolls or other anomalous behaviors across the markets.  But I’ve never looked at ETFs the way they really should be understood: as structured products that should have well-defined (if not necessarily obvious) properties.

Like many structured products, some of these characteristics are not obvious and may be quite unintuitive but are always important to understand.  For instance, the hedging required to implement these funds is both non-linear and asymmetric.

Specifically, leveraged ETFs must re-balance their exposures on a daily basis to produce the promised leveraged returns. What may seem counterintuitive is that irrespective of whether the ETFs are leveraged, inverse or leveraged inverse, their re-balancing activity is always in the same direction as the underlying index’s daily performance. The hedging flows from equivalent long and short leveraged ETFs thus do not “offset” each other. [...]

The impact is particularly significant for inverse ETFs. For example, a double-inverse ETF promising -2X the index return requires a hedge equal to 6X the day’s change in the fund’s Net Asset Value (NAV), whereas a double-leveraged ETF requires only 2X the day’s change. This daily re-leveraging has profound microstructure e ffects, exacerbating the volatility of the underlying index and the securities comprising the index.

Hence Mr Zweig’s concern that these ETFs feed the volatility we’ve seen for the last 8 months or so near the market close.  If the day has been up then both “bull” and “bear” levered ETFs will need to buy in order to stay hedged – reinforcing the trend and effectively supporting serial correlation of returns.

Read more…

dereferenced, portfolio management, strategy development