Kamis, 31 Mei 2007

Stop Loss, Profits Cap, Survivorship Bias, In Addition To Dark Swans

I accept long espoused the sentiment that nosotros should non impose stop-losses on mean-reverting strategies, nor profits caps on momentum strategies. My sentiment on the latter has non changed, but it has evolved on the former.

My master copy argue for opposing stop-losses on mean-reverting strategy is this. Say yous believe your specific cost serial is mean-reverting, in addition to tell yous accept entered into a long position when the cost is low. Now, however, the cost gets much lower, in addition to yous are suffering a large unrealized loss. Well, based on your mean-reverting belief, yous should purchase to a greater extent than instead of liquidating! Indeed, if yous backtest the number of stop-losses on mean-reverting strategies, yous volition close inevitably discovery that they decrease the overall returns in addition to fifty-fifty Sharpe ratios.

But what this simplistic sentiment ignored is 1) survivorship bias, in addition to 2) dark swan events. (Hat tip: Ben, who prompted me to reckon these ii issues.)

1) We unremarkably would alone merchandise those cost serial alongside a mean-reverting strategy alone if nosotros run into that the prices did eventually revert. No ane would bother to merchandise those cost serial that used to mean-revert, but all of a abrupt stopped doing so. But maxim that stop-losses are harmful to mean-reverting strategies is ignoring the fact that some mean-reverting volition halt working altogether in addition to would non live on our strategies choice process.

2) Let's define dark swan events equally those that did non travel on inward your backtest period. For example, let's tell yous never had a loss of 20% inward a unmarried day. So if yous backtest a stop-loss of 20%, it volition accept no number whatsoever on your backtest performance. However, no ane tin tell for sure that it won't travel on inward the future. So if yous or your investors exactly cannot tolerate a 20% loss, yous should impose this equally a stop-loss. (After all, your brokerage has already imposed a stop-loss of 100% on yous whether yous similar it or not.)

We tin inward fact plow betoken 2) roughly when deciding what stop-loss to use: a stop-loss should live liberate plenty in addition to then that it should accept no number on the backtest performance, in addition to of course of pedagogy tight plenty in addition to then that it volition non resultant inward the demise of your trading career.

There is too the number of whether to purpose stop-loss on the intraday drawdown, or to purpose it on the multiple-day drawdown. I would struggle that alone intraday stop-loss is of import to forestall a black-swan loss. In practice, when a strategy has a string of non-catastrophic losses occurring over multiple days, resulting inward a large, unprecedented, drawdown, the trader volition typically re-examine the strategy, taking into concern human relationship this most recent functioning in addition to tweak the strategy in addition to then that it could theoretically live avoided. This is close similar a multi-day stop-loss strategy, equally nosotros halt an old strategy in addition to showtime a new, modified, one. (Though the modified strategy mightiness soundless recommend that yous conk along asset the electrical flow position!)

Now why am I soundless asset love to the regulation that ane should non impose profit-caps on momentum strategies? Why, the possibility of dark swan events again! But this time, whatever dark swan tin alone resultant in unprecedented one-day gain instead of loss, since nosotros should always have stop-losses on momentum strategies. We for certain don't desire to impose a profit-cap to dominion out this possibility!

Trading Platform In Addition To Ec2 Revisited

Recently I opened a discussion on the diverse software platforms which allow the programmers with us to construct trading strategies easily. Here is 1 other addition: Quantopian. It is exclusively inwards alpha stage, simply I did acquire a preview of its features:

1) You tin code inwards Python, which is an easier linguistic communication to larn than Java, simply no less powerful. In fact, I know of a superb programmer who uses Python to backtest HF strategies.

2) It is web-based, which agency you lot tin accept wages of collocation on a server much to a greater extent than stable than your ain desktops. (For those who worry well-nigh the confidentiality of your strategies, the founder indicated to me that they tin run an icon of the software on an Amazon EC2 concern human relationship that you lot owned then they won't induce got access to your codes. As for the confidentiality of codes residing on EC2 itself, delight encounter below*.)

3) It is event-driven (or for those who similar the latest jargon: CEP-enabled), similar all the Java API's that I discussed inwards the previous article.

4) They induce got 1-min U.S.A. equities information for backtesting. Tick-level information volition live available soon.

5) Toolboxes for mutual technical indicators, mathematical algorithms, etc. volition live available soon.

6) They volition run a contest for trading models which makes it easier for independent traders to run past times away trading advisers to others, or to heighten coin for their ain funds.

Unfortunately, alive walk-forward testing is non yet available.

* Some readers induce got wondered whether it is prophylactic to run their trading models on Amazon's EC2. Won't Amazon's employees induce got access to their wildly profitable strategies? The respond is no: Amazon's security policy:


Guest Operating System: Virtual instances are completely controlled past times the customer. Customers induce got sum origin access 
or administrative command over accounts, services, as well as applications. AWS does non induce got whatsoever access rights to customer 
instances as well as cannot log into the invitee OS....

Thanks to a reader OL from French Republic who provided me with this info. He likewise told me that: 

"So, I lastly deployed my momentum strategy on a Linux trial of EC2 (which is gratuitous btw).
I wrote it based on the coffee present application provided past times Interactive Brokers as well as about parts of Algoquant.
So far, I role a European trial of EC2 which alas doesn't induce got the best latency to IB U.S.A. servers (90 ms) simply nevertheless ameliorate than my sleeping accommodation connection. 
Influenza A virus subtype H5N1 examination ping from a U.S.A. trial to IB U.S.A. servers results inwards exclusively fifteen ms ..."

So at that topographic point you lot go: Java+Algoquant+IB+EC2=profit.

Rabu, 30 Mei 2007

Risk Indicators

During the fiscal crisis of 2008, I wrote about how I watched some risk indicators such every bit the VIX or the TED spread  to create upward one's heed what leverage I should use for my trading strategies. It turns out that this physical care for is simply every bit critical for the electrical current crisis that began inward August 2011. In fact, to a greater extent than than leverage-determinants, they tin locomote used every bit the all-important variable that determines whether a for certain strategy should locomote run at all. (What's the betoken of running a model that y'all mean value volition lose coin amongst depression leverage?)


There are instantly to a greater extent than than a few of these risk indicators to selection from. Besides the VIX in addition to the TED, at that topographic point are the VSTOXX (EURO STOXX fifty Volatility), the VXY (JPMorgan G7 Volatility Index), the EM-VXY (JPMorgan Emerging Market Volatility Index), the ETF's ONN and OFF, in addition to belike many to a greater extent than that I haven't heard of yet. 


A lot of academic enquiry has been done on whether nosotros tin devise "regime switching" models based on some complicated pattern-recognition algorithms to create upward one's heed whether a marketplace is inward a for certain "regime" which favors this or that item model or parameter set. And often, these authorities switching models rely on the recognition of some complicated laid upward of patterns inward the historical cost series. Sorry to say, I accept non establish whatever of these complex authorities switching model to accept whatever existent out-of-sample predictive power. On the other hand, my enquiry shows that some of the aforementioned elementary risk indicators volition indeed forestall some trading models from falling off the cliff.


But which of these indicators are applicable to which model? This is non so obvious. For example, y'all powerfulness mean value that the EM-VXY would locomote an ideal leading indicator for Forex trading models that demand emerging marketplace currencies, but I accept establish that it is solely a contemporaneous (and hence useless) indicator to mine. Another example, I said during the 2008 fiscal crisis that VIX seems to locomote a useless contemporaneous indicator for equities trading models, but strangely, it is a expert leading indicator for FX models. In contrast, the TED spread that everyone were obsessed close inward 2008 shot upward to over 300 bps then, but never went beyond 100 bps this fourth dimension around. So actually solely rigorous backtesting tin guide us here.


What risk indicators produce y'all use? And accept y'all actually backtested their efficacies? Your comments would locomote real welcome here.

Selasa, 29 Mei 2007

What Worked Inward 2011?

We all know that 2011 was a bad twelvemonth for many hedge funds, amongst the average fund down 5%. But what type of strategies did well, together with what did peculiarly poorly? The numbers are out: Forex funds lose to a greater extent than than average, downwards 6%. In fact, 71 out of 77 Forex funds tracked past times a Citigroup currency analyst were downwards inwards 2011. And the winners are? Statarb funds, amongst a 5% averge return.

This superior surgical operation of statarb funds is quite a contrast from the final fiscal crisis 2007-9. Then, most of the large factor-driven statarb models failed miserably. What caused this difference? Is it because the conduct chances management techniques of large funds convey improved? Or perchance that's because inwards 2011, the divergence from constituent returns mean-revert inside a few days, together with then those statarb models that re-balance on a daily footing tin create goodness from the buying/selling chance at steep discount/premium?

To settle this question, permit me study the 2011 backtest results (without transaction costs) of running Andrew Lo's paradigm mean-reversion model : ranking stocks based on their previous day's returns, shorting the overstep decile together with buying the bottom one, rebalancing exclusively at the close. (Click on nautical chart to acquire far larger.)



The APR inwards 2011 was 18.6%. Note inwards item its surgical operation since the crisis began officially on 20110808: despite a steep drawdown, the overall surgical operation was spectacular! Clearly, high volatility benefited a prototypical statarb strategy, together with the out-performance has non much to create amongst improved conduct chances management.

You mightiness wonder what would hand if nosotros had used the intraday version of this strategy instead: endure into all positions at the open, together with endure out them all at the close? I tried it: the surgical operation is surprisingly similar to the interday strategy. So intraday vs. interday volatility or mean-reversion does non appear to play a purpose inwards final year's equities market. Contrasting this amongst the surgical operation of Forex models, it is clear that high volatilities benefited statarb models piece they wound FX models.

In the side past times side article or two, I volition explore the 2011 surgical operation of another equities mean-reverting models that I used to trade. But what almost your models? If you lot convey simply about thoughts on what worked together with what didn't inwards 2011, delight part them amongst us inwards the comments section.

Senin, 28 Mei 2007

Ideas From A Psychologist

I receive got merely finished reading Daniel Kahneman's bestseller "Thinking, Fast as well as Slow", as well as establish it sum of inspirations of import for traders. This is no surprise, of course, since Kahneman won the 2002 Nobel prize inward economic science for his function on determination theory. Here are unopen to of the notables:

1) Simple pith is oft improve than a linear regression fit. Remember my constant mantra that "simpler is better" when edifice trading models? I receive got e'er advocated linear regression over nonlinear models, but Kahneman went a pace further. He said that inward social scientific discipline modeling (which of flat includes fiscal markets modeling), assigning equal weights to the predictive factors is oft superior to weighting them using multivariate linear regressors when applied to out-of-sample data.

2) Overconfidence inward corporate acquisitions. Managers of acquiring companies oft believe that they are improve than the managers of acquirees. This overconfidence has several causes: in that location is an illusion of command which overemphasizes the component subdivision of science as well as neglects the component subdivision of luck, as well as in that location is a focus on what 1 knows as well as a fail of what 1 does not, etc. The marketplace seat already knows this: the stock of the acquirer normally suffers a sell-off upon proclamation of the acquisition, because the upshot of whatsoever acquisition is to a greater extent than oft bad than good, but the query is whether it has sufficiently discounted this phenomenon. Would shorting the stock of an acquirer at the completion of an acquisition as well as asset the brusk seat for, say, v years, hedging this seat alongside SPY, move profitable?

3) Premortem. After designing a trading strategy, it is e'er useful to write a brief imaginary history of how it has cash inward one's chips an unmitigated fiscal disaster for yous a few years from now. This volition probable break scenarios that yous receive got non previously idea of, as well as triggering additional direct a opportunity administration measures.

4) Risk seeking inward the aspect upwards of losses. Suppose yous are running a strategy that has a fixed asset period. Have yous ever extended this asset catamenia when the seat is losing, inward the promise that the seat volition recoup unopen to of its losses? I have, as well as the upshot was double the loss I would receive got suffered had I exited on time. Apparently this is a rattling mutual suboptimal behavioral bias: this is why many defendants alongside a weak legal illustration oft direct a opportunity continued litigations instead of accepting an unfavorable settlement.

5) Why create nosotros oft need Sharpe ratio  >=2? Psychological experiments receive got shown that people discovery the hurting of losing $1 tin plough over the axe entirely move compensated past times the pleasance of winning $2. So if nosotros equate criterion difference equally the average drawdown of a strategy, hence nosotros require to receive got twice the average return!

Many businesses receive got profited from arbitraging the difference betwixt rational decisions as well as biased decisions that people commonly made. (For e.g. lottery franchises create goodness from people overweighting the probability of winning, sellers of extended warranties create goodness from buyers' risk-aversion.) I wonder if in that location are still opportunities left for rational traders to convey payoff of the biased decisions of irrational traders?

Minggu, 27 Mei 2007

Hidden Markov Model Applied To Fx Prediction

I read amongst involvement an older newspaper "Can Markov Switching Models Predict Excess Foreign Exchange Returns?" yesteryear Dueker as well as Neely of the Federal Reserve Bank of St. Louis. I direct maintain a fondness for hidden Markov models because of its dandy success inward spoken language recognition applications, exactly I confess that I direct maintain never been able to create a HMM model that outperforms elementary technical indicators. I blame that both on my ain lack of inventiveness equally good equally the fact that HMM tend to direct maintain equally good many parameters that postulate to last fitted to historical data, which makes it vulnerable to information snooping bias. Hence I approached this newspaper amongst the dandy promise that experts tin laissez passer on notice instruct me how to apply HMM properly to finance.

The objective of the model is simple: to predict the excess supply of an central charge per unit of measurement over an 8-day period. (Excess supply inward this context is measured yesteryear the % modify inward the central charge per unit of measurement minus the involvement charge per unit of measurement differential  between the base of operations as well as quote currencies of the currency pair.) If the expected excess supply is higher than a threshold (called "filter" inward the paper), as well as thence acquire long. If it is lower than or thence other threshold, acquire short. Even though the prediction is on a 8-day return, the trading determination is made daily.

The excess supply is assumed to direct maintain a 3-parameter student-t distribution. The iii parameters are the mean, the marking of freedom, as well as the scale. The scale parameter (which controls the variance) tin laissez passer on notice switch betwixt a high as well as depression value based on a Markov model. The marking of liberty (which controls the kurtosis, a.k.a. "thickness of the tails") tin laissez passer on notice also switch betwixt ii values based on or thence other Markov model. The hateful is linearly theme on the values assumed yesteryear the marking of liberty as well as the scale equally good equally or thence other Markov variable that switches betwixt ii values. Hence the hateful tin laissez passer on notice assume viii distinct values. The iii Markov models are independent. The student-t distribution is to a greater extent than appropriate for the modelling fiscal returns than normal distribution because of the allowance for heavy tails. The authors also believe that this model captures the switch betwixt periods of high as well as depression volatility, amongst the consequent modify of preference (=different hateful returns) for "safe" versus "risky" currencies, a phenomenon well-demonstrated inward the menses betwixt August 2011 to Jan 2012.

The parameters of the Markov models as well as the student-t distributions are estimated inward the in-sample menses (1974-1981) for each currency dyad inward social club to minimize the cumulative departure of the excess returns from zero. There are a full of fourteen parameters to last thence estimated. After these estimations, nosotros direct maintain to also approximate the ii trading thresholds yesteryear maximizing the in-sample supply of the trading strategy, assuming a transaction costs of 10 footing betoken per trade.

With this large release (16 inward total) of parameters, I dread to come across the out-of-sample (1982-2005) results. Amazing, these are far ameliorate than I expected: the annualized returns attain from 1.1% to 7.5% for iv major currency pairs. The Sharpe ratios are non equally impressive: they attain from 0.11 to 0.71. Of course, when  researchers study out-of-sample results, 1 should accept that amongst a grain of salt. If the out-of-sample results weren't good, they wouldn't last reporting them, as well as they would direct maintain kept changing the underlying model until goodness "out-of-sample" results are obtained! So it is actually upward to us to implement this model, apply it to information afterwards 2005 as well as to to a greater extent than currency pairs, to honour out if in that location is actually something here. In fact, this is the argue why I prefer to read older papers - to permit for the possibility of truthful out-of-sample tests immediately.

What exercise you lot scream back tin laissez passer on notice last done to improve this model? I suspect that equally a origin step, 1 tin laissez passer on notice come across whether the estimated Markov states stand upward for reasonably to what traders scream back of equally risk-on vs risk-off regimes. If they do, as well as thence regardless of the usage of this model equally a signal generator, it tin laissez passer on notice at to the lowest degree generate good risk indicators. If not, as well as thence perchance the hidden Markov model postulate to last replaced amongst a Markov model that is conditioned on observable indicators.

Sabtu, 26 Mei 2007

High-Frequency Trading Inward The Unusual Central Market

This is the championship of a report published past times the Bank of International Settlements (which serves key banks roughly the world) inwards September 2011. As a Forex trader myself, I of course peruse it amongst dandy involvement hoping to glimpse whatever is the state-of-the-art. Here are a few interesting nuggets, together amongst my commentary:

1) FX HFT travel amongst a latency of less than 1 ms, spell nearly of us mere algorithmic traders typically endure a latency of at to the lowest degree 10ms.  For example, Interactive Brokers does non withal furnish collocation facilities for its customers, too then the best nosotros tin produce is to house our trading servers on the cyberspace backbone unopen to its Stamford, CT, location. The best round-trip ping fourth dimension is 10ms. Those who merchandise amongst FXCM may cause got a improve run a hazard for lower latency, equally they furnish free collocation to their clients. Those who merchandise on the ECN FXall tin collocate at their Equinix information center, spell FCM360 provides collocation service to EBS traders. I cannot honor whatsoever collocation service for Hotspot FX or Currenex. If you lot know of such services, or FX brokers who furnish collocation, produce exit a comment!

2) HFT typically travel inwards markets amongst high liquidity too depression volatility. The one-time is non surprising, since markets amongst depression liquidity has few counter-parties to accept payoff of. The latter requires a fleck of nuance. I retrieve nearly HFT would produce goodness from high volatility inwards a mean-reverting market, simply unfortunately high volatility is ordinarily correlated amongst marketplace inwards a gratuitous fall. So don't live on surprised if you lot honor that HFT-provided liquidity all of a abrupt disappears when the marketplace is inwards stress, though the BIS written report stated that they are equally good quick to re-enter the marketplace in 1 trial the turmoil is over.

3) As a corollary of 2), HFT to a greater extent than oft than non merchandise inwards the major currency pairs. But increasingly, NZD too MXN cause got drawn many automated too HF traders.

4) Almost past times definition, the bid/ask quotes placed past times HFT tend to remain on the mass for a really brusk time, measured inwards ms, unless forced past times the telephone commutation to rest longer. EBS too Reuters both has minimum quote life or minimum create amount ratio. One telephone commutation that does not have such minimums is Currenex, which is hence specially attractive to HF trading. Hence if you lot are non a HF player, too produce non wishing to live on taken payoff of  by a HF player, live on wary of Currenex!

5) Two of the favourite categories of HFT strategies: triangle arbitrage too liquidity-redistribution (taking payoff of pricing discrepancies across dissimilar trading platforms.) Despite the bad reputation HFTers cause got been acquiring inwards the concluding few years, I retrieve they produce furnish a useful service to other algo traders similar myself via these ii strategies. It is a hassle to give-up the ghost on looking for a improve broker/prices for your strategy!

The Life In Addition To Expiry Of A Strategy

Sometimes it is instructive to hold off dorsum at some strategies that used to thrive, in addition to hence quite of a abrupt contracted a chronic affliction that ultimately led to its demise. It gives us a feel of the unreliability of backtests in addition to curb our over-confidence, which is e'er useful when dealing amongst the fiscal markets.

One skillful instance is a well-known strategy that nosotros called "buy-on-gap". In its simplest version, only purchase at the opened upwards 100 stocks inside the S&P500 which accept the lowest returns from their previous day's lows to the electrical current day's open, provided that these returns are lower than ane criterion deviation. (The criterion departure is computed every bit the 90-day moving criterion departure of close-to-close returns of a stock.) Exit such  long positions at the day's close.

Many traders know of variants of this strategy, in addition to I started trading it to a greater extent than or less the initiative of all of 2007, in addition to inward fact, it formed role of my initiative of all fund's portfolio of strategies. You tin post away run across the cumulative render nautical chart below (click to enlarge) from 2007/01/03-2008/10/29. The APR is 19%, unlevered. The Sharpe ratio is 1.4 in addition to the maximum drawdown is only 4%. Note that Lehman Brothers went bankrupt on 2008/09/15, in addition to this is a long-only strategy, notwithstanding the surgical physical care for was spectacular inward September-October 2008. We were patting ourselves furiously on the back.




Now hold off what happened afterward this happy period.
 The APR was -6%. 2008/10/29 turned out to endure the high watermark.

I accept seen some strategies that accept the contrary behavior: misfortunate surgical physical care for prior to 2009, in addition to stellar surgical physical care for since then. Was in that location a structural interruption inward the marketplace due to the fiscal crisis? Was this due to the advent of high frequency trading? The declining book inward the equities market? I volition run out these deep questions to fiscal economists. The entirely lesson I accept learned from this in addition to other examples is that, in ane trial a strategy is inward spend upwards for some time, it seldom comes dorsum to health, in addition to the best course of written report of activeness is to bury it swiftly.

Jumat, 25 Mei 2007

A Few Announcements

First, an iPad version of this weblog has been launched, together with then if y'all are reading this on an iPad, the hold back volition last different. If y'all desire to acquire dorsum to the onetime look, only hitting Page Turn inwards the bottom left corner together with select the option there. Any comments or suggestions on this novel hold back are nearly welcome!

Second, together with this is likely irrelevant to nearly of y'all reading this blog, a Chinese translation of my mass is instantly available.

Third, together with nearly interesting, Larry Connors volition last hosting a previous post! I accept ever flora Larry's strategies to last clear, concise, together with uncomplicated - just the ingredients for out-of-sample every 2nd opposed to in-sample returns!

Kamis, 24 Mei 2007

Momentum Strategies: A Mass Review

As a devout mean-reversion trader, I detect Mike Dever's novel majority "Jackass Investing" unexpectedly well-argued in addition to readable.

You see, momentum in addition to mean-reversion traders alive inwards 2 split upwardly universes, in addition to they are oftentimes mutually incomprehensible to each other. Dever, every bit a CTA, inhabits the momentum universe. Example: my favorite functioning measure, the Sharpe ratio, has been brusquely dispatched every bit a bad standard of risk, in addition to drawdown becomes king. But all for skillful reasons: Dever argues that Sharpe ratio measures solely the daily volatility of returns, only disregarded the "black swan" events, which are much amend captured yesteryear the maximum drawdown. I handgrip alongside the writer on this point, only at that spot are other uses of Sharpe ratio: a high Sharpe ratio strategy does signal high statistical significance of the trading strategy, a claim that momentum strategies tin seldom make. I oftentimes scream upwardly of momentum strategies every bit beingness long options: you lot cause got to proceed paying premium until 1 day, you lot brand them all dorsum alongside a dwelling run. But when you lot are backtesting a strategy, how would you lot know that the rare, statistically insignificant, dwelling run was non due to information snooping bias? Unless of course, similar the author, you lot cause got key insights into the traded instruments.

Fundamental insights are inwards fact 1 of the delicious highlights of this book. Dever describes his orangish juice futures strategy using the "marginal cost of production" every bit a key valuation tool. He argues that orangish juice cannot live on sold below this cost, since farmers would cause got no incentive for production otherwise. And he was right: orangish juice futures started to rebound from the 27-year depression of 55 cents/pound inwards May 2004, to almost xc cents/pound inwards September (thanks partly to hurricanes hitting Florida). Dever went long at lxx cents. Oh, how nosotros quantitative traders would beloved to cause got the confidence that such insights inspire!

Of course, I don't handgrip alongside everything written inwards the book. For example, though the writer rightly pointed out that the distribution of returns oftentimes cause got a positive kurtosis, he uses that every bit bear witness of trending behavior. While I handgrip that toll trends tin indeed arrive at positive kurtosis, nosotros tin surely fix mean-reverting toll serial alongside occasional catastrophes that cause got the same kurtosis. To us mean-reversion traders, positive kurtosis is non an invitation to "follow-the-trend", only every bit a alarm sign to detect run a endangerment management measures that protect us from catastrophes. 

Even though momentum strategies inwards full general are inwards a acre of trauma correct directly (more on that later), Dever notwithstanding makes a skillful representative why nosotros should include them every bit piece of occupation of our portfolio of strategies. Comparing the S&P500 index (SPX) alongside the S&P Diversifed Trends Indicator (DTI, a unproblematic trend-following strategies on 24 futures), he finds that the Sharpe ratio (though of course of report he refuses to utilisation that hated term) of the DTI is to a greater extent than than double that of the SPX, alongside solely virtually 1/3 of the maximum drawdown. But earlier you, the reader, decides to bring together the momentum bandwagon, I invite you lot to cause got a aspect at a plot of DTI's values since inception:
reversion traders alive inwards 2 split upwardly universes Momentum strategies: a majority review
S&P DTI index
Since its high watermark inwards 2008/12/5, this representative momentum strategy has been inwards a relentless drawdown. Why? This is due to to a greater extent than or less other well-studied in addition to troubling property of momentum strategies: they ever performed poorly for several years after a fiscal crisis.






Rabu, 23 Mei 2007

Extracting Curlicue Returns From Futures

Futures returns consist of ii components: the returns of the spot cost too the "roll returns". This is sort of obvious if y'all cry back nearly it: suppose the spot cost remains constant inward fourth dimension (and hence has aught return). Futures amongst unlike maturities volition soundless own got unlike prices at whatever indicate inward time, too yet they must all converge to the same spot cost at expirations, which way they must own got non-zero returns during their lifetimes. This whorl provide is inward activity every day, non only during the rollover to the adjacent nearest contract. For some futures, the magnitude of this whorl provide tin sack endure real large: it averages nearly -50% annualized for VX, the volatility futures. Wouldn't it endure squeamish if nosotros tin sack somehow extract this return?

In theory, extracting this provide should endure easy: if a futurity is inward backwardation (positive whorl return), only purchase the futurity too brusque the underlying asset, too vice versa if it is inward contango. Unfortunately, shorting, or fifty-fifty buying, an underlying property is non easy. Except for precious metals, most commodity ETFs that concur "commodities" truly concur entirely their futures (e.g. USO, UNG, ...), too so they are of no assist at all inward this arbitrage strategy. Meanwhile, it is too a chip inconvenient for us to become out too purchase a few crude oil tankers ourselves.

But inward arbitrage trading, nosotros ofttimes attain non involve an exact arbitrage relationship: a statistical probable human relationship is adept enough. So instead of using a commodity ETF every bit a hedge against the future, nosotros tin sack purpose a commodity-producer ETF. For example, instead of using USO every bit a hedge, nosotros tin sack purpose XLE, the unloosen energy sector ETF that holds unloosen energy producing companies. These ETFs should own got a higher bird of correlation amongst the spot cost than attain the futures, too hence real suitable every bit hedges. In cases where the futures attain non rail commodities (as inward the instance of VX), however, nosotros own got to await harder to discovery the proper hedge.

Which brings me to this fresh-off-the-press paper past times David Simon too Jim Campasano. (Hat tip: Simon T.) This newspaper suggests a trading strategy that tries to extract the real juicy whorl returns of VX. The hedge they advise is -- y'all guessed it! -- the ES future. In a nutshell: if VX is inward contango (which is most of the time), only brusque both VX too ES, too vice versa if VX is inward backwardation. 


Why does ES move every bit a adept hedge? Of course, its real negative correlation amongst VX is the major factor. But ane should non overlook the fact that ES too has a real modest whorl provide (about +1.5% annualized). In other words, if y'all desire to discovery a futurity to deed every bit a hedge, await for ones that own got an insignificant whorl return. (Of course, if nosotros tin sack discovery a futurity that has high correlation amongst your master copy futurity but which has a high whorl provide of the contrary sign, that would endure ideal. But nosotros are seldom that lucky.)


P.S. The reader Simon who referred me to this newspaper too drew my attending to an apparent contradiction betwixt its determination too my before spider web log post: Shorting the VIX Calendar Spread. This newspaper says that it is profitable to brusque VX when it is inward contango and hedge amongst brusque ES, acre I said it may non endure profitable to brusque the front end contract of VX when it is inward contango too hedge amongst long dorsum contract of VX. Both statements are true: hedging amongst the dorsum contract of VX brings real trivial attain goodness because both the front end too dorsum contracts are suffering from real similar whorl returns, too so at that topographic point is trivial provide left when y'all accept contrary positions inward them!

Selasa, 22 Mei 2007

An Options Workshop Together With Other Miscellany

I confess I accept ever flora it difficult to merchandise options. This is despite having read around of the "bibles" of options trading, including Lawrence McMillan's Options every bit a Strategic Investment and Euan Sinclair's Option Trading: Pricing as well as Volatility Strategies as well as Techniques. Partly that is because I prefer elementary strategies, as well as options strategies are rarely simple. Partly that is because I was brought upwards on stocks, merely stock options are depressingly illiquid. Most successful options traders that I know of prefer to merchandise index options instead, an expanse that I unfortunately accept no intuition at all. Papers as well as books written past times options professionals on this topic tend to live on dense alongside equations, as well as worse, they seldom focus on the practical side of trading.

That's why I am pleased to acquire that Larry Connors, whose books I savor due to their simplicity of exposition, is presenting his get-go ever quantitative index options trading seminars. Interested traders tin register for his complimentary preview webinars on August ix as well as xv here, or a pre-recorded preview here.

===

Speaking of seminars, readers inwards Asia may live on interested to know that my ain workshops on Backtesting as well as Statistical Arbitrage volition live on held inwards Hong Kong on Oct 2-5. The same workshops volition live on held inwards London on Nov 19-22.

(I savor giving those workshops real much, because many of the participants are institutional traders whose cognition as well as points of sentiment are real much at the cutting edge. Past participants include quants as well as traders from, inwards no exceptional order, Goldman Sachs, Morgan Stanley, Royal Bank of Scotland, Bank of America, UBS, Societe Generale, Deutsche Bank, BNP Paribas, JP Morgan, Barclays, Citigroup, Blackrock, as well as diverse other Asian as well as European hedge funds, unloose energy companies, banks, as well as property managers.  I humbly submit that the in-class discussions are sometimes to a greater extent than interesting than my prepared materials.)

===

I wrote around fourth dimension agone most those FX brokers or ECNs where algo-traders tin colocate their trading programs to lower latency for a reasonable price. There are besides like options for futures algo-traders. For e.g. Optimus Trading Group provides a marketplace information service called Rithmic which is colocated at the major futures exchanges, as well as traders tin colocate alongside Rithmic to cut down latency. Of course, traders tin besides straight colocate at the novel CME information pump inwards Aurora, IL. I suspect, though, that the cost of the latter pick volition live on considerable.

====

Finally, every bit a quant trader, I soundless read macroeconomic analyses occasionally, if exclusively to figure out why around of my strategies of a abrupt start to fail. One website that provides interesting analysis of the unloose energy markets is oilprice.com. In particularly, this interview alongside economical commentator Mike Shedlock is unusually detailed as well as thoughtful.

Senin, 21 Mei 2007

Order Period Of Time Every Moment A Predictor Of Return

Order period of time is signed transaction volume: if an companionship is executed at the enquire price, the incremental companionship period of time is +(order size); if executed at the bid price, it is -(order size). In for certain markets where traders tin plough over notice only purchase in addition to sell from marketplace makers but non from each other, a positive companionship period of time way that traders are cyberspace buyers of a security. But fifty-fifty inwards markets where everyone tin plough over notice house in addition to fill upwards orders on a mutual companionship book, a positive companionship period of time indicates that informed traders (those willing to aggressively locomote inwards a position) are eagerly acquiring a security.

The bang-up affair almost companionship period of time is that it has proven to last a proficient momentum indicator. That is to say, a positive period of time predicts a positive futurity return. This mightiness appear trivially obvious, but y'all convey think that to a greater extent than frequently than non speaking, a positive past times provide past times no way predicts a positive futurity return. That FX companionship period of time possesses this predictive ability was shown past times Evans in addition to Lyons inwards a serial of papers, but this indicator is useful inwards many other markets, in addition to at many dissimilar fourth dimension scales. For example, inwards a paper past times Coval in addition to Stafford, it was shown that if y'all tin plough over notice tease out the companionship period of time of a stock due to mutual funds' trading alone, y'all tin plough over notice also predict its futurity provide upwards to, say, a quarter. This newspaper non only shows that companionship period of time is predictive, but that sometimes a specific sort of companionship period of time (in this case, that of mutual funds only) is sometimes to a greater extent than predictive than full general companionship flow. In many cases, traders notice that past times counting only companionship period of time due to institutional traders, or companionship period of time due to large orders, they tin plough over notice ameliorate predict futurity returns. (No wonder institutional traders are trying their darnedest to interruption upwards their orders into pocket-size chunks, or to merchandise inwards nighttime pools!) I of late also heard that companionship period of time into sector ETFs tin plough over notice last predictive of that sector's return. If whatever reader has read papers or has sense amongst this type of sector rotation model, delight acquire out a comment!

Despite the proven usefulness of companionship flow, non besides many retail traders utilize it. The argue is simple: it tin plough over notice last difficult to measure. In FX inwards particular, many markets exercise non written report merchandise information, or they written report amongst a sufficient delay such that the information has no predictive utility. Even for markets that written report instantaneous merchandise information, y'all would demand a proficient slice of software to capture every bid, ask, trade, in addition to merchandise size, in addition to shop them inwards an array, inwards companionship to compute companionship flow, an functioning that most retail trading software cannot accomplish. However, this barrier to entry may but hateful that at that topographic point are nonetheless decent alpha to last extracted from this indicator.

Now, a bunch of world service announcements ...

===

Influenza A virus subtype H5N1 novel algorithmic trading platform called Rizm designed for retail traders is forthwith available. You tin plough over notice sign upwards for their beta trial here.

===

gold/gold-miners arb strategy with origin codes in addition to analysis available. I notice that the performance metrics clear in addition to useful: ameliorate than the output from my ain backtest programs! (Quantopian is a platform where y'all tin plough over notice portion backtest results in addition to codes amongst other traders.)

===

Arbmaker is a platform for duo traders, in addition to it incorporates software for cointegration tests, has integrated information feed from many vendors, in addition to allows automated companionship submission to Interactive Brokers. Neural networks in addition to Kalman filter are also included.

===

Finally, I volition last giving a speak titled "Backtesting in addition to Its Pitfalls" at the World MoneyShow at the Metro Toronto Convention Centre on Saturday, Oct 20. Interested readers tin plough over notice register here.

A Leveraged Etfs Strategy

In a post approximately years ago, I argued that leveraged ETF (especially the triple leveraged ones) are unsuitable for long-term holdings. Today, I desire to introduce inquiry that suggests leveraged ETF tin hold out rattling suitable for short-term trading.

The inquiry inwards interrogation was simply published by Prof. Pauline Shum as well as her collaborators at York University. Here is the simplest version of the strategy: if a stock marketplace seat index has experienced a provide >= 2% since the previous day's closed upwards to the electrical flow fourth dimension at 2:15pm ET, as well as thus purchase this index (via its futures, ETFs, or stock components) correct away, as well as acquire out at the closed with a market-on-close order. Vice versa if the provide is <= -2%. The annualized average provide from June 2006 to July 2011 was constitute to hold out higher than 100%.

Now this strategy is truly quite well-known with institutional traders, although this is the get-go fourth dimension I view the backtest results published. The ground why it plant is likewise quite well-known: it has to produce with the fact that every leveraged ETF demand to rebalance at the marketplace seat closed inwards social club to expire on its leverage constant (at x2 or x3, depending on the fund). If the marketplace seat index goes up, the fund needs to purchase the gene stocks; otherwise, it needs to sell stocks. If at that spot is major marketplace seat motility (with absolute provide >= 2%) since the previous close, as well as thus the sum of stocks that demand to hold out bought or sold volition hold out correspondingly larger, resulting inwards momentum inwards all those stocks nigh the close. This strategy aims to front-run this rebalancing to receive got payoff of the anticipated momentum.

It has been estimated that if the marketplace seat moves past times 1%, the rebalancing could trouble concern human relationship for upwards to 16.8% of the market-on-close volume, thus the induced momentum tin hold out substantial. Now who is paying for this profits for those momentum traders? Why, the buy-and-hold investors, of course. This loss for the ETFs shows upwards equally their tracking errors, resulting inwards a cost of equally much equally 5% per annum for the buy-and-hold investors. Yet approximately other ground nosotros should non hold out 1 of those investors!

As Prof. Shum pointed out, if y'all merchandise this strategy alive today, y'all volition probable acquire a lower return, because of all those momentum traders who drove upwards the toll trend earlier the close. However, at that spot may hold out an ameliorating factor at function here: this momentum is proportional to the NAVof the ETFs. As their NAV goes upwards with fourth dimension (either due to additional subscriptions or positive marketplace seat returns), the returns of this strategy should likewise increase.

===
Now for approximately world service announcements:

1) H5N1 fellowship called Level iii Data Corp sells proprietary information indicating buying as well as selling pressure level on stocks. Their internal backtests present that adding these information to approximately mutual stock trading strategies essentially double their returns. An explanatory video is available, as well as I heard they are offering 3-month costless trials.

2) The London Systematic Traders (LST) Club has asked me to country a few words nigh their novel first to laid upwards a London centric collaborative community of traders, developers as well as researchers.

LST aims to hold out at the intersection of traders, developers as well as quants with a rigid emphasis community edifice as well as on cognition exchange, providing a trading networks with a rattling specific focus on systematic, algorithmic (i.e. automated) or quantitative trading.

Membership is costless as well as opened upwards to everybody with an involvement inwards the higher upwards topics.

http://www.meetup.com/London-Systematic-Traders/

On Friday, November 23, I await to hold out hosting a Q&A session with members of the LST (see 2 above) at the Apex Hotel inwards London. All are welcome. Please see their website for details.

3) I volition hold out conducting my Backtesting as well as Statistical Arbitrage workshops inwards London, November 19-22, as well as facial expression forwards to seeing approximately of our readers there!

Minggu, 20 Mei 2007

The Importance Of Ii (As Sharpe Ratio)

A reader ezbentley late pointed out a little-noticed fact inward the derivation of Kelly's formula: if nosotros utilise the optimal Kelly leverage, together with thus the measure divergence of the annualized compounded growth charge per unit of measurement of your equity is none other than the Sharpe ratio (Sdev=S). This fact is of mild involvement inward itself, but its implication has relevance to around other interesting fact of behavioral finance, thus I volition reproduce our discussions here.

Suppose our strategy has an annualized Sharpe ratio of 2. According to the inward a higher house result, Sdev=2 every bit well. This may startle around of us: a measure divergence of 200% of our compounded increment charge per unit of measurement g - wouldn't ruin live on real likely? But banking corporation check out g itself: g=S^2/2, thus g=2 when S=2, which agency that g itself is just 200%. Influenza A virus subtype H5N1 Sdev of 200% hither agency that if the increment charge per unit of measurement drops ane measure divergence below its mean, nosotros volition withal deal non to lose coin for the year. Another mode to pose this is that in that place is a 84.1% lead chances that our annual supply volition live on greater than 0, based on the Gaussian distribution.

It gets ameliorate if southward goes inward a higher house 2. For example, at S=3, g=4.5, but Sdev is simply 3. So you lot tin dismiss come across that every bit southward goes inward a higher house 2, a 1 measure divergence fluctuation of g below the hateful volition withal acquire you lot a positive number: profitable for the year.

This is a real interesting result: this agency that S=2 is actually an of import threshold inward to a greater extent than ways that I realized. From behavioral finance experiments, nosotros already know that humans demands $2 profits for $1 risk. Given the universal wish of portfolio managers non to lose coin on the year, it turns out that the need of a Sharpe ratio of at to the lowest degree two is quite rational!

===

Now, fourth dimension for a duo of populace service announcements:

1) Those who are looking for a mode to connect Matlab to Interactive Brokers should banking corporation check out undocumentedmatlab.com. The creator of this production has an accompanying book, together with the documentation for the production is excellent.

2) NAG sells high surgical physical care for Matlab toolboxes for those who prefer alternatives to the native ones.

3) Here is the Twitter feed for FIXGlobal Online, the magazine from the creator of the FIX Protocol, an social club submission standard. Interesting breaking tidings from the global finance scene.

Sabtu, 19 Mei 2007

The Pseudo-Science Of Hypothesis Testing

Backtesting trading strategies necessarily involves a real express sum of historical data. For example, I seldom seek strategies amongst information older than 2007. Gathering longer history may non improve predictive accuracy since the marketplace position construction may convey changed substantially. Given such scant data, it is reasonable to query whether the expert backtest results (e.g. a high annualized provide R) nosotros may convey obtained is exactly due to luck. Many academic researchers attempt to address this number past times running their published strategies through  standard statistical hypothesis testing.

You know the drill: the researchers get-go come upwardly up amongst a supposedly splendid strategy. In a display of faux modesty, they in addition to then advise that possibly a zilch hypothesis tin create the same expert provide R. The zilch hypothesis may hold upwardly constructed past times running the master strategy through to a greater extent than or less random simulated historical data, or past times randomizing the merchandise entry dates. The researchers in addition to then proceed to demonstrate that such random constructions are highly unlikely to generate a provide equal to or improve than R. Thus the zilch hypothesis is rejected, in addition to thereby impressing yous that the strategy is somehow sound.

As statistical practitioners inwards fields exterior of finance volition say you, this whole physical care for is quite meaningless in addition to often misleading.

The probabilistic syllogism of hypothesis testing has the same construction equally the next unproblematic instance (devised past times Jeff Gill inwards his newspaper "The Insignificance of Null Hypothesis Significance Testing"):

1) If a individual is an American in addition to then it is highly unlikely she is a fellow member of Congress.
2) The individual is a fellow member of Congress.
3) Therefore it is highly unlikely she is an American.

The absurdity of hypothesis testing should hold upwardly clear. In mathematical terms, the probability nosotros are actually interested inwards is the conditional probability that the zilch hypothesis is truthful given an observed high provide R: P(H0|R). But instead, the hypothesis seek exactly gives us the conditional probability of a provide R given that the zilch hypothesis is true: P(R|H0). These 2 conditional probabilities are seldom equal.

But fifty-fifty if nosotros tin somehow compute P(H0|R), it is withal of real niggling use, since at that spot are an interplanetary space number of potential H0. Just because yous convey knocked downward 1 detail straw man doesn't say much close your master strategy.

If hypothesis testing is both meaningless and misleading, why exercise fiscal researchers proceed to peddle it? Mainly because this is de rigueur to buy the farm published. But it does serve 1 useful role for our ain individual trading research. Even though a rejection of the zilch hypothesis inwards no agency shows that the strategy is sound, a failure to turn down the zilch hypothesis volition hold upwardly far to a greater extent than interesting.

(For other references on criticism of hypothesis testing, read Nate Silver's bestseller "The Signal in addition to The Noise". Silver is of cast the statistician who correctly predicted the winner of all 50 states + D.C. inwards the 2012 U.S. of A. presidential election. The majority is highly relevant to anyone who makes a living predicting the future. In particular, it tells the floor of 1 Bob Voulgaris who makes $1-4M per annum betting on NBA outcomes. It makes me wonder whether I should quit making bets on fiscal markets in addition to motion on to sports.)

Jumat, 18 Mei 2007

A Stock Element Based On Selection Volatility Smirk

A reader pointed out an interesting paper that suggests using selection volatility smirk equally a constituent to rank stocks. Volatility smirk is the divergence betwixt the implied volatilities of the OTM position selection as well as the ATM telephone band option. (Of course, in that place are numerous OTM as well as ATM position as well as telephone band options. You tin cite to the master newspaper for a precise definition.) The consider is that informed traders (i.e. those traders who convey a superior mightiness inwards predicting the side past times side turn a profit numbers for the stock) volition predominately purchase OTM puts when they intend the hereafter turn a profit reports volition hold out bad, thence driving upwards the cost of those puts as well as their corresponding implied volatilities relative to the to a greater extent than liquid ATM calls. If nosotros piece of job this volatility smirk equally a constituent to rank stocks, nosotros tin cast a long portfolio consisting of stocks inwards the bottom quintile, as well as a brusk portfolio alongside stocks inwards the summit quintile. If nosotros update this long-short portfolio weekly alongside the latest volatility smirk numbers, it is reported that nosotros volition bask an annualized excess provide of 9.2%.

As a standalone factor, this 9.2% provide may non look terribly exciting, peculiarly since transaction costs convey non been accounted for. However, the beauty of constituent models is that yous tin combine an arbitrary let out of factors, as well as though each constituent may hold out weak, the combined model could hold out highly predictive. H5N1 search of the keyword "factor" on my spider web log volition reveal that I convey talked nearly many dissimilar factors applicable to dissimilar property classes inwards the past. For stocks inwards particular, in that place is a short term factor equally uncomplicated equally the previous 1-day provide that worked wonders. Joel Greenblatt's famous "Little Book that Beats the Market" used two factors to rank stocks (return-on-capital as well as turn a profit yield) as well as generated an APR of 30.8%.

The question, however, is how nosotros should combine all these dissimilar factors. Some constituent model aficionados volition no doubtfulness propose a linear regression fit, alongside hereafter provide equally the subject variable as well as all these factors equally independent variables. However, my sense alongside this method has been unrelentingly poor: I convey witnessed millions of dollars lost past times diverse banks as well as funds using this method. In fact, I intend the only sensible agency to combine them is to but add together them together alongside equal weights. That is, if yous convey 10 factors, but cast 10 long-short portfolios each based on ane factor, as well as combine these portfolios alongside equal capital. As Daniel Kahneman said, "Formulas that assign equal weights to all the predictors are ofttimes superior, because they are non affected past times accidents of sampling".


Kamis, 17 Mei 2007

A Workshop, A Webinar, Together With A Question

There is a workshop on the 25th of Feb titled "Market turbulence; monetization; together with universality" past times Mike Lipkin at Columbia University that promises to live on interesting to those traders who direct maintain a physics background. Mike is a old colleague of mine at Cornell's Laboratory of Atomic together with Solid State Physics, together with I fondly squall upward the expert old days when nosotros all hunched over the theory group's computers spell day-dreaming of our future. Mike has since gone on to acquire an options market-maker at the American Stock Exchange together with an Adjunct Associate Professor at Columbia. He published to a greater extent than or less real interesting query on the "stock pinning" phenomenon close options expirations, i.e. stock prices oft converge to the nearest smasher prices of their options simply earlier expirations.

---

If nosotros desire to merchandise straight on diverse FX ECNs such equally HotspotFX or EBS, maybe because nosotros desire to run to a greater extent than or less HFT strategies, nosotros volition postulate to live on sponsored past times a prime number broker. However, since the Dodd-Frank deed has been inward amount force, no prime number brokers that I know of are willing to accept on customers amongst less than $10M assets. (I oft experience that the CFTC's master copy destination is to preclude modest players similar myself from always competing amongst bigger institutions. Of course, their stated destination is to "protect" us from fiscal damage ....) The exclusively exception may live on CitiFX TradeStream ECN. Has whatsoever reader always traded on this market? Any reviews or comments volition live on close welcome.

---

I am right away offering an online workshop "Quantitative Momentum Strategies” to a direct issue of traders together with portfolio managers. It volition be conducted inward real-time through Skype, together with the issue of attendees volition live on express to 4. See here for to a greater extent than information.

Rabu, 16 Mei 2007

What Tin Quant Traders Larn From Taleb's Antifragile?

It tin dismiss appear a flake ironic that nosotros should live on discussing Nassim Taleb's best-seller "Antifragile" here, since around algorithmic trading strategies involve predictions as well as won't live on met alongside blessing from Taleb. Predictions, equally Taleb would say, are "fragile" -- they are prone to diverse biases (e.g. information snooping bias) as well as the occasional Black Swan consequence volition wipe out the small-scale cumulative profits from many right bets. Nevertheless, underneath the heap of diatribes against diverse luminaries ranging from Robert Merton to Paul Krugman, nosotros tin dismiss observe a few gems. Let me start from the obvious to the subtle:

1) Momentum strategies are to a greater extent than antifragile than mean-reversion strategies.

Taleb didn't tell that, but that's the starting fourth dimension idea that came to my mind. As I argued inwards many places, hateful reverting strategies receive got natural lucre caps (exit when toll has reverted to mean) but no natural halt losses (we should purchase to a greater extent than of something if it gets cheaper), then it is real much plain of report to left tail risk, but cannot accept payoff of the unexpected skilful fortune of the right tail. Very frail indeed! On the contrary, momentum strategies receive got natural halt losses (exit when momentum reverses) as well as no natural lucre caps (keep same seat equally long equally momentum persists). Generally, real antifragile! Except: what if during a trading halt (due to the daily overnight gap, or circuit breakers), nosotros can't move out a momentum seat inwards time? Well, you lot tin dismiss ever purchase an pick to copy a halt loss. Taleb would sure enough approve of that.

2) High frequency strategies are to a greater extent than antifragile than depression frequency strategies.

Taleb equally good didn't tell that, as well as it has zippo to produce alongside whether it is easier to predict short-term vs. long-term returns. Since HF strategies let us to accumulate profits much faster than depression frequency ones, nosotros withdraw non apply whatever leverage. So fifty-fifty when nosotros are unlucky plenty to live on asset a seat of the incorrect sign when a Black Swan hits, the harm volition live on small-scale compared to the cumulative profits. So spell HF strategies produce non precisely produce goodness from right tail risk, they are at to the lowest degree robust alongside observe to left tail risk.

3) Parameter estimation errors as well as vulnerability to them should live on explicitly incorporated inwards a backtest functioning measurement.

Suppose your trading model has a few parameters which you lot estimated/optimized using about historical information set. Based on these optimized parameters, you lot compute the Sharpe ratio of your model on this same data. No uncertainty this Sharpe ratio volition live on real good, due to the in-sample optimization. If you lot apply this model alongside those optimized the parameters on out-of-sample data, you lot would in all probability acquire a worse Sharpe ratio which is to a greater extent than predictive. But why halt at but ii information sets? We tin dismiss observe northward unlike information sets of the same size, calculate the optimized parameters on each of them, but compute the Sharpe ratios over the N-1 out-of-sample information sets. Finally, you lot tin dismiss average over all these Sharpe ratios. If your trading model is fragile, you lot volition observe that this Sharpe ratio is quite low. But to a greater extent than of import than Sharpe ratios, you lot should compute the maximum drawdown based on each laid of parameters, as well as equally good the maximum of all these max drawdowns. If your trading model is fragile, this maximum of maximum drawdowns is probable to live on quite scary.

The scheme I described higher upwards is called cross-validation as well as is well-known earlier Taleb, though his mass reminds me of its importance.

4) Notwithstanding 3) above, a truthful approximate of the max drawdown is impossible because it depends on the approximate of the probability of rare events. As Taleb mentioned, fifty-fifty inwards illustration of a normal distribution, if the "true" touchstone departure is higher than your approximate past times a mere 5%, the probability of a 6-sigma consequence volition live on increased past times five times over your estimate! So actually the solely means to ensure that our maximum drawdown volition non orbit a sure  limit is through Constant Proportion Portfolio Insurance: trading risky assets alongside Kelly-leverage inwards a express liability company, putting coin that you lot never desire to lose inwards a FDIC-insured bank, alongside regular withdrawals from the LLC to the depository fiscal establishment (but non the other means around).

5) Correlations are impossible to estimate/predict. The solely affair nosotros tin dismiss produce is to brusk at +1 as well as purchase at -1.

Taleb hates Markowitz portfolio optimization, as well as 1 of the reasons is that it relies on estimates of covariances of asset returns. As he said, a dyad of assets that may receive got -0.2 correlation over a long catamenia tin dismiss receive got +0.8 correlation over about other long period. This is particularly truthful inwards times of fiscal stress. I quite handgrip on this point: I believe that manually assigning correlations alongside values of  +/-0.75, +/-0.5, +/-0.25, 0 to entries of the correlation matrix based on "intuition" (fundamental knowledge) tin dismiss generate equally skilful out-of-sample functioning equally whatever meticulously estimated numbers.The to a greater extent than fascinating query is whether in that location is indeed mean-reversion of correlations. And if so, what instruments tin dismiss nosotros move to lucre from it? Perhaps this article volition help.

6) Backtest tin dismiss solely live on used to spend upwards a strategy, non to predict its success.

This echoes the indicate made past times commenter Michael Harris inwards a previous article. Since historical information volition never live on long plenty to capture all the possible Black Swan events that tin dismiss occur inwards the future, nosotros tin dismiss never know if a strategy volition neglect miserably. However, if a strategy already failed inwards a backtest, nosotros tin dismiss live on pretty sure that it volition neglect 1 time to a greater extent than inwards the future.

===

The online "Quantitative Momentum Strategies” workshop that I mentioned inwards the previous article is straightaway fully booked. Based on pop demand, I volition offering a "Mean Reversion Strategies" workshop inwards May. Once again, it volition live on conducted inwards real-time through Skype, as well as the pose out of attendees volition live on similarly express to 4. See here for to a greater extent than information.






An Integrated Evolution Environs For High Frequency Strategies

I bring come upward across many software platforms that allow traders to outset specify too backtest a strategy too then, alongside the force of a button, plough the backtest strategy into a alive trading programme that tin automatically submit orders to their favorite broker. (See all my articles on this topic here.)  I called these platforms "Integrated Development Environment" (IDE) inwards my new book, too they arrive at from the familiar too retail-oriented (e.g. MetaTrader, NinjaTrader, TradeStation), to the professional person but skills-demanding (e.g. ActiveQuant, Marketcetera, TradeLink),  and lastly to the comprehensive too industrial-strength (e.g. Deltix, Progress Apama, QuantHouse, RTD Tango). Some of these ask no programming skills at all, allowing you lot to build strategies yesteryear dragging-and-dropping, others run some uncomplicated scripting languages similar Python, too yet others need full-blown programming abilities inwards Java, C#, or C++. But which of these allow us to backtest too execute high frequency strategies?

To land the obvious: backtesting HFstrategies is quite hard. The mass of information is i issue. But inwards addition, the execution details are really of import to such strategies: details such as the exact exchange/venue to which nosotros are routing our orders, the precise land of the companionship mass that triggers our orders, the companionship types nosotros are using, too lastly the probability of getting filled if nosotros run non-marketable orders. Messing upward i of these details too the backtest volition live far from realistic. I oftentimes say people that it is easier to newspaper merchandise a HF strategy than to backtest one. While many of the platforms I reported to a higher house create allow backtesting using tick data, I don't know that they enable backtesting using the amount companionship mass too selection of execution venue. With this background, I am happy to study I bring lately come upward across but such a platform called Lime Strategy Studio.

First, the bad news. LimeTrader is useful alone to traders who merchandise alongside Lime Brokerage, equally it is configured to post alive orders to Lime only. [UPDATE: I bring since learned that at that spot are adapters available for third political party brokers.] However, if you lot are going to merchandise HF stocks too futures strategies, why non acquire alongside Lime, since they supply you lot alongside a comprehensive API, straight ultra-low latency feeds from the exchanges, too allow (nay, insist on) colocation either at the exchanges or at their information center at a reasonable fee? (Full Disclosure: I bring no electrical flow invoice alongside Lime, though I was a customer.) Another slice of bad news: the specification of the strategy must live inwards C++.

But i time you lot acquire over these two hurdles, the benefits are manifold. Every special that you lot tin specify for a alive trading strategy tin live specified for the backtest too newspaper trading. As I said, these details may include companionship type, trading venue, land of companionship book, too fifty-fifty statistics of the companionship book, non to advert primal information such equally earnings, corporate actions, too other user-provided information such equally news. Influenza A virus subtype H5N1 fill upward simulator is included for your non-marketable orders. As alongside other IDEs, i time you lot backtested a strategy inwards its every special too are satisfied alongside the surgical operation metrics, you lot tin acquire alive (either for newspaper or production trading) alongside the force of a button.

If whatever reader know of other IDEs that bring similar features too useful for backtesting HF strategies, delight allow us know!

===

Speaking of HF strategies, traders oftentimes lament the ultra-high secrecy some them too the difficulty of gathering noesis inwards this field. Influenza A virus subtype H5N1 friend (hat tip: Dave) referred me to this paper yesteryear Prof. Dragos Bozdog et. al. that gives a flavour of what assort of modeling may live involved. I abide by it really readable too thought-provoking.

===

There are nevertheless 2 slots available inwards my online Mean Reversion Strategies workshop scheduled for May.



Selasa, 15 Mei 2007

Nonlinear Trading Strategies

I own got long been partial to linear strategies due to their simplicity as well as relative immunity to overfitting. They tin move used quite easily to turn a profit from mean-reversion. However, at that topographic point is a serious problem: they are quite fragile, i.e. vulnerable to tail risks. As nosotros motility from mean-reverting strategies to momentum strategies, nosotros straight off innovate a nonlinearity (stop losses), simply simultaneously remove certain tail risks (except during times when markets are closed). But if nosotros desire to relish anti-fragility as well as are going to innovate nonlinearities anyway, nosotros mightiness also acquire full-monty, as well as reckon options strategies. (It is no surprise that Taleb was an options trader.)

It is slowly to encounter that options strategies are nonlinear, since options reward curves (value of an option as part of underlying stock price) are apparently nonlinear. I personally own got resisted trading them because they all look as well as so complicated, as well as I detest complexities. But lately a reader recommended a picayune mass to me: Jeff Augen's "Day Trading Options" where the Black-Scholes equation (and indeed whatever equation) is mercifully absent from the entire treatise. At the same time, it is suffused alongside qualitative ideas. Among the juicy bits:

1) We tin discovery distortions inward the 2D implied volatility surface (implied volatility equally z-axis, expiration months equally x, as well as nail prices equally y) which may hateful revert to "smoothness", thus presenting arbitrage opportunities. These distortions are introduce for both stock as well as stock index options.

2) Options are underpriced intraday as well as overpriced overnight: thus it is oft a proficient sentiment to purchase them at the marketplace seat opened upwardly as well as sell them at marketplace seat closed (except on roughly exceptional days! See iv below.). In fact, at that topographic point are certainly days of the calendar week where this distortion is the nearly drastic as well as thus favorable to this strategy.

3) Certain cash instruments own got unusually high kurtosis, simply their corresponding selection prices consistently underprice such tail risks. Thus structures such equally strangles or backspreads tin oft move profitable without incurring whatever left tail risks.

4) If at that topographic point is a long weekend earlier expiration solar daytime (e.g. Easter weekend),  the fourth dimension decay of the options value over three days is compressed into an intraday decline on the final trading solar daytime earlier the weekend.

Now, equally quantitative traders, nosotros own got no require to accept his give-and-take on whatever of these assertions. So, onward to backtesting!

(For those who may move stymied yesteryear the lack of affordable historical intraday options data, I recommend Nanex.net.)

===

There are even as well as so two slots available inward my online Mean Reversion Strategies workshop inward May. The workshop volition move conducted live via Adobe Connect, and is express to a sum of iv participants. Part of the workshop volition focus on how to avoid getting wound when a couple or a portfolio of instruments halt cointegrating.

Senin, 14 Mei 2007

My Novel Majority On Algorithmic Trading Is Out

A reader (Hat tip: Ken) told me that my novel majority Algorithmic Trading: Winning Strategies too Their Rationale is directly available for buy at Amazon.com. The deviation amongst my previous book? Influenza A virus subtype H5N1 lot to a greater extent than sample strategies with an emphasis on their "rationale", too to a greater extent than advanced techniques. It covers stocks, futures, too FX. A big thank-you to my editors, reviewers, too you, the reader, for your on-going support.

And when y'all are done amongst it, delight post a review on Amazon whether y'all similar it or loathe it!

Also, I am directly offering a live online course of teaching on Backtesting in June. It covers inward excruciating details the diverse nuances of conducting a right backtest too the numerous pitfalls i tin watch when backtesting dissimilar types of strategies too property classes. For syllabus too registration details, delight see my website.



Minggu, 13 Mei 2007

Momentum Crash Together With Recovery

In my book I devoted considerable attending to the phenomenon of "Momentum Crashes" that professor Kent Daniel discovered. This refers to the fact that momentum strategies by in addition to large function real poorly inward the immediate aftermath of a fiscal crisis. This phenomenon obviously spans many property classes, in addition to has been to a greater extent than or less since the Great Depression.  Sometimes it lasted multiple decades, in addition to at other times these strategies recovered during the lifetime of a momentum trader. So how bring momentum strategies fared later on the 2008 fiscal crisis, in addition to bring they recovered?

First, let's hold off at the Diversified Trends Indicator (formerly the S&P DTI index), which is a fairly generic trend-following strategy applied to futures.  Here are the index values since inception (click to enlarge):



in addition to hither are the values for 2013:




After suffering relentless refuse since 2009, it has finally shown positive returns YTD!

Now hold off at a momentum strategy on the soybean futures (ZS) that I bring been working on. Here are the cumulative returns from 2009 to 2011 June:


in addition to hither the cumulative returns since then:


The deviation is stark!

Despite evidences that indeed momentum strategies bring enjoyed a full general recovery, nosotros must play the business office of skeptical fiscal scientists in addition to hold off for option theories. If whatsoever reader can tell us an alternative, plausible explanation why ZS should commencement to display trending behaviour since July 2011, precisely non before, delight ship service that inward the comment area. The prize for the best explanation: I volition expose inward mortal to a greater extent than details nearly this strategy to that reader. (To claim the prize, delight include the finally four digit of your band release inward the ship service for identification purpose.)

===
Upcoming events:
  1. I volition live instruction an online workshop on Momentum Strategies from July thirty - August 1. Registration information tin ambit the sack live flora here.
  2. My friend doc Haksun Li is offering a Certificate inward Quantitative Investment serial of courses.