Tuesday, August 19, 2014

Q uantitative T rading, E RNEST P. C HAN : Chp2

Fishing for Ideas












  • Finding a trading idea is actually not the hardest part of building a quantitative trading business.
  • finance and investment books, newspapers and magazines, mainstream media web sites, academic papers available online or in the nearest public library, trader forums, blogs, and on and on.

















  • I have found that many strategies described by academics are either too complicated, out of date (perhaps the once-profitable strategies have already lost their power due to competition), or require expensive data to backtest (such as historical fundamental data). Furthermore, many of these academic  strategies work only on small-cap stocks, whose illiquidity may render actual trading profits far less impressive than their backtests would suggest.
  • I have found that many traders’ forums or blogs may suggest simpler strategies that are equally profitable.
  • Most ready-made strategies that you may find in these places actually do not withstand careful backtesting:  may have worked only for a little while, or they work for only a certain class of stocks, or they work only if you don’t factor in transaction costs.
  • the trick is that you can often modify the basic strategy and make it profitable (see chp3) - for example:  decreasing the holding period and entering and exiting at different times than suggested.

  • HOW TO IDENTIFY A STRATEGY THAT SUITS YOU

    Your Working Hours - Do you trade only part time?  consider strategies that hold overnight and not the intraday strategies. Otherwise, you may have to fully automate your strategies



  • "When I was working full time for others and trading part time for myself, I traded a simple strategy in my personal account that required entering or adjusting limit orders on a few exchange-traded funds (ETFs) once a day, before the market opened. Then, when I first became independent, my level of automation was still relatively low, so I considered only strategies that require entering orders once before the market opens and once before the close. Later on, I added a program that can automatically scan real-time market data and transmit orders to my brokerage account throughout the trading day when certain conditions are met. So trading remains a “part-time” pursuit for me, which is partly why I want to trade quantitatively in the first place."
  • Your Programming Skills - know Visual Basic or even Java, C#, or C++?  you can explore:
    • high-frequency strategies, 
    • trading large number of securities.
    Otherwise:
    • strategies that trade only once a day, or 
    • trade just a few stocks, futures, or currencies.
    (or hire a software contractor)
    Your Trading Capital
    • I would not recommend quantitative trading for an account with less than $50,000 capital.
    • the dividing line between a high- versus low-capital account is $100,000.
    • With a low-capital account, we need to find strategies that can utilize the maximum leverage available.
    1. First choice: whether you should open a retail brokerage account or a proprietary trading account (see chp4)
    2. low-capital account: find strategies that can utilize the maximum leverage available. Trading futures, currencies, and options can offer you higher leverage than stocks; intraday x4, interday (overnight) x2
    3. capital (or leverage) availability determines whether you should focus on directional trades (long or short only) or dollar-neutral trades (hedged or pair trades) :      "A dollar neutral portfolio (meaning the market value of the long positions equals the market value of the short positions) or market-neutral portfolio (meaning the beta of the portfolio with respect to a market index is close to zero, where beta measures the ratio between the expected returns of the portfolio and the expected returns of the market index) require twice the capital or leverage of a long- or short-only portfolio. So even though a hedged position is less risky than an unhedged position, the returns generated are correspondingly smaller and may not meet your personal requirements."
    4. infrastructure, data, and software : capital availability =>  how much you can spend on various infrastructure, data, and software:           clean historical stock data with high frequency costs more than historical daily stock data; (high frequency stock-trading strategy may not be feasible with small capital expenditure.)          Historical data free of survivorship bias is more expensive.    news (such as Bloomberg), fundamental (good historical database with fundamental data on companies)
    "when I first started I downloaded only the split-and-dividend-adjusted Yahoo! Finance data using the download program from HQuotes.com (more on the different databases and tools in Chapter 3). This database is not survivorship bias–free—but more than two years later, I am still using it for most of my backtesting! In fact, a trader I know, who each day trades more than 10 times my account size, typically uses such biased data for his backtesting, and yet his strategies are still profitable. How can this be possible? Probably because these are intraday strategies. It seems that the only people I know who are willing and able to afford survivorship bias–free data are those who work in money management firms trading tens of millions of dollars or more (that includes my former self). So, you see, as long as you are aware of the limitations of your tools and data, you can cut many corners and still succeed."
    Your Goal 
    most traders: earn a steady (hopefully increasing) monthly, or at least quarterly, income.
    OR (for independently wealthy) : long-term capital gain is all that matters to you.




  • The strategies to pursue for short-term income versus long-term capital gain are distinguished mainly by their holding periods.
  • the more regularly you want to realize profits and generate income, the shorter your holding period should be.
  • even if your strategy holds a stock only for a month on average, your month-to-month profit fluctuation is likely to be fairly large (unless you hold hundreds of different stocks in your portfolio, which can be a result of staggering your portfolios), and therefore you cannot count on generating income on a monthly basis.
  • misconception:  if your goal is to achieve maximum long-term capital growth, then the best strategy is a buy-and-hold one. The truth: finding a strategy with the maximum Sharpe ratio, provided that you have access to sufficiently high leverage.
  • A TASTE FOR PLAUSIBLE STRATEGIES AND THEIR PITFALLS

    Have you read about promising strategy with great historical returns? Before wasting more time backtesting it/money on trading it, some quick checks:
    How Does It Compare with a Benchmark and How Consistent Are Its Returns?
    1. Compare to benchmark
    1.1 for a stock trading strategy that buys (but not shorts) stocks: comparing to index fund: 10 percent a year is not too fantastic.
    1.2 for a long-short dollar-neutral strategy (i.e., the portfolio holds long and short positions with equal capital): comparing to the benchmark of risk-less asset such as the yield of the three-month U.S. Treasury bill (which at the time of this writing is about 4 percent): 10 percent is quite good!
    2. consistency of the returns: information ratio or Sharpe ratio (Sharpe,
    1994), rather than returns, as the proper performance measurement of a quantitative trading strategy.

    Information ratio: the measure to use for long-only strategy:

    where benchmark=the market index to which the securities you are trading belong.
    [i.e.: if you trade only small-cap stocks, the market index should be the Standard & Poor’s
    small-cap index or the Russell 2000 index, rather than the S&P 500.]

    Sharpe ratio : suitable for dollar-neutral strategy. (special case of the information ratio)  Benchmark to use is always the risk-free rate.
    (In practice, most traders use the Sharpe ratio even when they are trading a directional (long or short only) strategy, simply because it facilitates comparison across different strategies.

  • A higher Sharpe ratio will actually allow you to make more profits in the end, since it allows you to trade at a higher leverage. It is the leveraged return that matters in the end, not the nominal return of a trading strategy.
  • If a strategy trades only a few times a year, chances are its Sharpe ratio won’t be high. This does not prevent it from being part of your multistrategy trading business, but it does disqualify the strategy from being your main profit center.
  • If a strategy has deep (e.g., more than 10 percent) or lengthy (e.g., four or more months) drawdowns => low Sharpe
  • =>inspect equity curve (which is also the cumulative profit-and-loss curve, assuming no redemption or cash infusion) to see if it is very bumpy or not.




  • Sharpe's Tips:
    1. strategy with Sharpe ratio < 1 : not suitable as a stand-alone strategy.
    2. For a strategy that achieves profitability almost every month, its (annualized) Sharpe ratio is typically greater than 2.
    3. For a strategy that is profitable almost every day, its Sharpe ratio is usually greater than 3.
    How Deep and Long Is the Drawdown?
    • definition: drawdown at time t = the difference between the current equity value (assuming no redemption or cash infusion) of the portfolio and the global maximum of the equity curve occurring on or before time t.
    • definition: The maximum drawdown is the difference between the global maximum of the equity curve with the global minimum of the curve after the occurrence of the global maximum
    • The global maximum is called the “high watermark.”
    • The maximum drawdown duration is the longest it has taken for the equity curve to recover losses
    • drawdowns are measured in percentage terms, with the denominator being the equity at the high watermark, and the numerator being the loss of equity since reaching the high watermark.
    • The maximum drawdown and the maximum drawdown duration do not typically overlap over the same period.
    • Drawdown is gut-wrenching and emotionally disturbing. Needs to be minimized. 
    • You have to ask yourself, realistically, how deep and how long a drawdown will you be able to tolerate and not liquidate your portfolio and shut down your strategy?
    How Will Transaction Costs Affect the Strategy?
    • The more frequent it trades, the larger the impact of transaction costs
    • not just due to commission fees:
    • cost of liquidity: when buying/selling at market prices, you are paying the bid-ask spread. When using limit orders, however, you avoid the liquidity costs but incur opportunity costs (the order may not be executed, may miss out on the potential profits of your trade)
    • market impact: When buying/selling large chunk of securities => impacting the prices (Sometimes just displaying a bid to buy a large number of shares for a stock can move the prices higher without your having bought a single share yet!)
    • delay between transmission of order to execution =>  “slippage” , the difference between the price that triggers the order and the execution price.
    • Bottom line : HOW MUCH? 
    • Estimation: half the average bid-ask spread of a security and then adding the commission if your order size is not much bigger than the average sizes of the best bid and offer.
    • For S&P 500 stocks: the average transaction cost (excluding commissions, which depend on your brokerage) would be about 5 basis points (round trip will cost 10 basis points in this example)
    • For ES, the E-mini S&P 500 futures, the transaction cost will be about 1 basis point.
    Does the Data Suffer from Survivorship Bias?

    A historical database of stock prices that does not include stocks that have disappeared due to bankruptcies, delistings, mergers, or acquisitions suffer from the so-called survivorship bias.

    Backtesting using data with survivorship bias can be dangerous: may inflate strategy's performance: especially if the strategy has a “value” bent (tends to buy stocks that are cheap; some of them were cheap because they went to bankruptcy).


    How Did the Performance of the Strategy Change over the Years?

    Most strategies performed much better 10 years ago than now, at least in a backtest. 
    • There weren’t as many hedge funds running quantitative strategies then. 
    • Bid-ask spreads were much wider then: So if you assumed the transaction cost today was applicable throughout the backtest, the earlier period would have unrealistically high returns.
    • Survivorship bias in the data might also contribute to the good performance in the early period. Survivorship bias mainly inflates the performance of an earlier period (the further back we go in our backtest, the more missing stocks we will have): a long-only strategy would have looked better than it should
    => when judging a strategy, pay particular attention to its performance in the most recent few years, and not be fooled by the overall performance, which inevitably includes some rosy numbers back in the old days.

    - "regime shifts” in the financial markets can mean that financial data from an earlier period simply cannot be fitted to the same model that is applicable today.
    • securities market regulation (such as decimalization of stock prices or the elimination of the short-sale rule)
    • macroeconomic events (such as the subprime mortgage meltdown).

    This is "hard to swallow" for many statistically minded readers: may think that the more data there is, the more statistically robust the backtest should be. true only when the financial time series is generated by a stationary process. Unfortunately, financial time series is famously nonstationary, due to all of the reasons given earlier.




    Does the Strategy Suffer from Data-Snooping Bias?
    too many parameters? you can optimize the strategy so it will look fantastic on historical data, but its future performance will probably be very poor. You are probably fitting the model to historical accidents in the past that will not repeat themselves in the future.

    => data-snooping bias. 
    Very hard to avoid even if you have just one or two parameters (such as entry and exit thresholds).
    See chp 3 for how to minimize its impact. In general:
    • the more rules the strategy has, and the more parameters the model has, the more likely it is go- ing to suffer data-snooping bias. Simple models are often the ones that will stand the test of time
    Does the Strategy “Fly under the Radar” of Institutional Money Managers?

    Since this book is about starting a quantitative trading business from scratch, and not about starting a hedge fund that manages multiple millions of dollars, we should not be concerned whether a strategy is one that can absorb multiple millions of dollars. (Capacity is the technical term for how much a strategy can absorb without nega- tively impacting its returns.) In fact, quite the opposite—you should look for those strategies that fly under the radar of most institutional investors, for example, strategies that have very low capacities be- cause they trade too often, strategies that trade very few stocks ev- ery day, or strategies that have very infrequent positions (such as some seasonal trades in commodity futures described in Chapter 7). Those niches are the ones that are likely still to be profitable because they have not yet been completely arbitraged away by the gigantic hedge funds.


    SUMMARY

    1. Finding prospective quantitative trading strategies is not difficult. There are:

    • Business school and other economic research web sites.
    • Financial web sites and blogs focusing on the retail investors.
    • Trader forums where you can exchange ideas with fellowtraders.

    After you have done a sufficient amount of Net surfing or trading magazine riffling, you will find a number of promising trading strategies.

    2. Whittle them down to just a handful based on your personal circumstances and requirements, and by applying the screening criteria (more accurately described as healthy skepticism) that I listed earlier:

    • How much time do you have for baby-sitting your trading pro- grams?
    • How good a programmer are you?
    • How much capital do you have?
    • Is your goal to earn steady monthly income or to strive for a large, long-term capital gain?

    3. Even before doing an in-depth backtest of the strategy, you can quickly filter out some unsuitable strategies if they fail one or more of these tests:

    • Does it outperform a benchmark?
    • Does it have a high enough Sharpe ratio?
    • Does it have a small enough drawdown and short enough drawdown duration?
    • Does the backtest suffer from survivorship bias?
    • Does the strategy lose steam in recent years compared to its earlier years?
    • Does the strategy have its own “niche” that protects it from intense competition from large institutional money managers?

    4. After making all these quick judgments, you are now ready to proceed to the next step: 

    to rigorously backtest the strategy yourself to make sure that it does what it is advertised to do.

    No comments:

    Post a Comment