Selasa, 01 Mei 2007

Beware Of Depression Frequency Data

(This post is based on the beak of the same championship I gave at Quantopian's NYC conference which commenced at 3.14.15 9:26:54. Do these numbers remind you lot of something?)

Influenza A virus subtype H5N1 right backtest of a trading strategy requires accurate historical data. This isn't controversial. Historical information that is sum of errors volition generate fictitious profits for mean-reverting strategies, since dissonance inwards prices is mean-reverting. However, what is lesser known is how perfectly accurate capture of historical prices, if done inwards a sub-optimal way, tin silent atomic number 82 to dangerously inflated backtest results. I volition illustrate this alongside 3 elementary strategies.

CEF Premum Reversion

Patro et al published a paper on trading the hateful reversion of closed-end funds’ (CEF) premium. Based on rational analysis, the marketplace seat value of a CEF should last the same every bit the internet property value (NAV) of its holdings. So the strategy to exploit whatever differences is both reasonable as well as simple: rank all the CEF's past times their % deviation ("premium") betwixt marketplace seat value as well as NAV, as well as curt the quintile alongside the highest premium as well as purchase the quintile alongside the lowest (maybe negative) premium. Hold them for a month, as well as repeat. (You tin endeavour this on a daily dry ground too, since Bloomberg provides daily NAV data.) The Sharpe ratio of this strategy from 1998-2011 is 1.5. Transaction costs are ignored, but shouldn't last pregnant for a monthly rebalance strategy.

The authors are irreproachable for their purpose of high character toll information provided past times CRSP and monthly fund NAV information from Bloomberg for their backtest. So I was quite confident that I tin reproduce their results alongside the same information from CRSP, as well as alongside historical NAV information from Compustat instead. Indeed, hither is the cumulative returns nautical chart from my ain backtest (click to enlarge):


However, I also know that at that spot is i item that many traders as well as academic researchers fail when they backtest daily strategies for stocks, ETFs, or CEFs. They often purpose the "consolidated" closing toll every bit the execution price, instead of the "official" (also called "auction" or "primary") closing price. To sympathise the difference, i has to recollect that the U.S. of America stock marketplace seat is a network of over sixty "market centers" (see the teaching notes of Prof. Joel Hasbrouck for an fantabulous review of the U.S. of America stock marketplace seat structure). The exact toll at which one's lodge volition last executed is highly subject on the exact marketplace seat middle to which it has been routed. Influenza A virus subtype H5N1 natural means to execute this CEF strategy is to ship a market-on-close (MOC) or limit-on-close (LOC) lodge close the close, since this is the means nosotros tin participate inwards the closing auction as well as avoid paying the bid-ask spread. Such orders volition last routed to the principal central for each stock, ETF, or CEF, as well as the toll it is filled at volition last the official/auction/primary toll at that exchange. On the other hand, the toll that close gratuitous information service (such every bit Yahoo Finance) provides is the consolidated price, which is just that of the terminal transaction received past times the Securities Information Processor (SIP) from whatever i of these marketplace seat centers on or earlier 4pm ET. There is no argue to believe that one's lodge volition last routed to that especial marketplace seat middle as well as was executed at that toll at all. Unfortunately, the CEF strategy was tested on this consolidated price. So I create upward one's take away heed to backtest it over again alongside the official closing price.

Where tin nosotros give away historical official closing price? Bloomberg provides that, but it is an expensive subscription. CRSP information has conveniently included the terminal bid as well as inquire that tin last used to compute the mid toll at 4pm which is a practiced guess of the official closing price. This mid toll is what I used for a revised backtest. But the CRSP information also doesn't come upward inexpensive - I solely used it because my academic affiliation allowed me gratuitous access. There is, however, an unexpected source that does supply the official closing toll at a reasonable rate: QuantGo.com volition rent us tick information that has a Cross flag for the closing auction trade. How ironic: the cheapest means to properly backtest a strategy that trades solely i time a calendar month requires tick information time-stamped at 1 millisecond, alongside special tags for each trade!

So what is the cumulative returns using the mid toll for our backtest?


Opening Gap Reversion

Readers of my book will last familiar alongside this strategy (Example 4.1): rootage alongside the SPX universe, purchase the 10 stocks that gapped downwardly close at the open, as well as curt the 10 that gapped upward most. Liquidate everything at the close. We tin apply diverse technical or cardinal filters to brand this strategy to a greater extent than robust, but the essential driver of the returns is mean-reversion of the overnight gap (i.e. reversion of the render from the previous to a greater extent than or less today's open).

We accept backtested this strategy using the closing mid toll every bit I recommended above, as well as including a farther v bps transaction cost each for the entry as well as move out trade. The backtest looked wonderful, therefore nosotros traded it live. Here is the comparing of the backtest vs alive cumulative P&L:


Yes, it is silent mildly profitable, but nowhere close the profitability of the backtest, or to a greater extent than precisely, walk-forward test. What went wrong? Two things:

  • Just similar the closing price, nosotros should accept used the official/auction/primary opened upward price. Unfortunately CRSP does non supply the opening bid-ask, therefore nosotros couldn't accept estimated the opened upward toll from the mid price. QuantGo, though, does supply a Cross flag for the opening auction merchandise every bit well.
  • To generate the bound on opened upward (LOO) or marketplace seat on opened upward (MOO) orders suitable for executing this strategy, nosotros demand to submit the lodge using the pre-market quotes earlier 9:28am ET, based on Nasdaq's rules.
Once again, a strategy that is seemingly depression frequency, alongside just an entry at the opened upward as well as an move out at the close, genuinely requires TAQ (ticks as well as quotes) information to backtest properly.

Futures Momentum

Lest you lot think that this requirement for TAQ information for backtesting solely applies to hateful reversion strategies, nosotros tin consider the next futures momentum strategy that tin last applied to the gasoline (RB), aureate (GC), or diverse other contracts trading on the NYMEX.

At the destination of a trading session (defined every bit the previous day's opened upward outcry to a greater extent than or less today's opened upward outcry close), rank all the trades or quotes inwards that session. We purchase a contract inwards the side past times side session if the terminal toll is inwards a higher house the 95th percentile, sell it if it drops below the 60th (this serves every bit a halt loss). Similarly, nosotros curt a contract if the terminal toll is below the fifth percentile, as well as purchase comprehend if it goes inwards a higher house the 40th.

Despite existence an intraday strategy, it typically trades solely 1 roundtrip a 24-hour interval - a depression frequency strategy. We backtested it 2 ways: alongside 1-min merchandise bars (prices are from back-adjusted continuous contracts provided past times eSignal), as well as alongside best bid-offer (BBO) quotes alongside 1 ms fourth dimension stamps (from QuantGo's actual contract prices, non backadjusted). 

For all the contracts that nosotros accept tested, the 1-ms information produced much worse returns than the 1-min data. The argue is interesting: 1-ms information shows that the strategy exhibits high frequency flip-flops. These are abrupt changes inwards the lodge mass (in particular, BBO quotes) that chop-chop revert. Some observers accept called these flip-flops "mini flash crashes", as well as they move on every bit often inwards the futures every bit inwards the stock market, as well as occasionally inwards the spot Forex marketplace seat every bit well. Some people accept blamed it on high frequency traders. But I think flip-flop depict the province of affairs ameliorate than flash crash, since flash crash implies the abrupt disappearance of quotes or liquidity from the lodge book, spell inwards a flip-flopping situation, novel quotes/liquidity inwards a higher house the BBO tin of a abrupt appear as well as disappear inwards a few milliseconds, simultaneous alongside the disappearance as well as re-appearance of quotes on the reverse side of the lodge book. Since ours is a momentum strategy, such reversals of class create losses. These losses are really real, as well as nosotros experienced it inwards alive trading. But these losses are also undetectable if nosotros backtest using 1-min bar data.

Some readers may object: if the 1-min bar backtest shows practiced profits, why non just merchandise this alive alongside 1-min bar information as well as save its profit? Let's consider why this doesn't genuinely permit us to avoid using TAQ data. Note that nosotros were able to avoid the flip-flops using 1-min information solely because nosotros were lucky inwards our backtest - it wasn't because nosotros had some trading dominion that prevented our entering or exiting a seat when the flip-flops occurred. How as well as therefore are nosotros to ensure that our luck volition boot the bucket on alongside alive marketplace seat data? At the really least, nosotros accept to essay this strategy alongside many sets of 1-min bar data, as well as direct the ready that shows the worst returns every bit business office of our stress testing. For example, i ready may last [9:00:00, 9:01:00, 9:02:00, ...,] as well as the 2nd ready may last [9:00:00.001, 9:01:00.001, 9:02:00.001, ...], etc. This backtest, however, silent requires TAQ data, since no historical information vendor I know of provides such multiple sets of time-shifted bars!

As I mentioned above, these  flip-flops are omnipresent inwards the stock marketplace seat every bit well. This shouldn't last surprising considering that 50% of the stock transaction mass is due to high frequency trading. It is especially damaging when nosotros are trading spreads, such every bit the ETF twain EWA vs EWC. Influenza A virus subtype H5N1 small-scale alter inwards the BBO of a leg may stand upward for a large per centum alter inwards the spread, which itself may last just a few ticks wide. So such flip-flops tin often trigger orders which are filled at much worse prices than expected. 

Conclusion

The 3 instance strategies inwards a higher house illustrate that fifty-fifty when a strategy trades at depression frequency, perhaps every bit depression every bit i time a month, nosotros often silent require high frequency TAQ information to backtest it properly, or fifty-fifty economically. If the strategy trades intraday, fifty-fifty if just i time a day, as well as therefore this requirement becomes all the to a greater extent than of import due to the flip-flopping of the lodge mass inwards the millisecond fourth dimension frame.

===
My Upcoming  Talks as well as Workshops

5/13-14: "Mean Reversion Strategies", "AI techniques inwards Trading" as well as "Portfolio Optimization" at Q-Trade Bootcamp 2015, Milan, Italy. 
6/17-19: "Mean Reversion Strategies" live online workshop.

===
Managed Account Program Update

Our FX Managed Account program has a internet render of +4.29% inwards March (YTD: +12.7%).

===
Follow me on Twitter: @chanep

Tidak ada komentar:

Posting Komentar