backtesting

back to index

description: the process of testing a trading strategy or model on historical data

53 results

Alpha Trader

by Brent Donnelly  · 11 May 2021

, and Thinking in Bets by Annie Duke). A full list of book recommendations appears in Appendix A. Backtest your ideas. If you notice that stocks tend to fall every Monday and rally every Tuesday, backtest it. If it feels like oil rallies every day from 2PM to 3PM, check it out. Is

this can inspire new ideas and a better understanding of the inner workings of the markets you trade. If you don’t know how to backtest, just open Excel and start messing around. This is the kind of thing you can teach yourself with a bit of effort. Calibrated confidence Given

sideways? Why don’t they fall upwards?” When you see a phenomenon in the markets, ask why. This is particularly true when backtesting. When you discover a pattern that backtests successfully, can you explain why it works? If you can, there is a much greater probability that what you discovered will work

stop out of a trade, don’t do the same trade again for 24 hours (and don’t move stops to avoid triggering this rule!) Backtest and build a new trading system for the NASDAQ open. Contact three traders or other peers each day to share ideas or dialogue. When you

impressive data showing that a particular strategy has generated outsized returns. Remember that this is all backward looking. Using any simple trading software, I can backtest a few thousand strategies and then cherry pick the ones that were incredibly profitable in hindsight. Then advertise those. The problem with this sort of

set of data will eventually yield what looks like a decent strategy if you torture it long enough. If you want to learn more about backtesting and the pitfalls of datamining, there is a lesser-known book called Fooled by Technical Analysis: The perils of charting, back-testing and data mining

. Not always. But almost always. 7. If you have a constant need for activity, find productive outlets. Every time you have an idea for a backtest, trading strategy or analysis, write it down so that you have a list of projects to pursue when you are bored. I am constantly jotting

taken at face value. Most of them are meaningless and have no empirical basis. Take half an hour to pull some data into Excel and backtest the pattern. Does it have any predictive value? When I say “patterns” that does not just mean technical analysis. It is any cause-and-effect

pattern, reduce it to something you can test and then get to work. You don’t need sophisticated quantitative skills to do basic backtesting of simple theories. Once you backtest a pattern, you have a much deeper understanding of whether or not it is random, and you know whether to factor it

.11. Chart courtesy of Refinitiv I got set on the trade the day after payrolls (at 107.75) and USDJPY went pretty much straight down. Backtesting is an entire field of quantitative research and there is considerable complexity involved. I am not a computational finance or applied math expert, so I

’t tweak the parameters or snoop around until I find something useful. I just go in, test, and get out. While a full course in backtesting is beyond the scope of this book, you don’t need a degree in financial engineering to conduct basic

backtests of patterns you identify and ideas you come up with. When testing your hypothesis, be aware of a few things: 1. The law of small

good but if there is a big difference, then something is up and you need to dig deeper. A common source of discrepancy in my backtesting work is that when I include data from 2008, the moves that year can often swamp the average and distort the analysis. This will show

time also much less risky, if compared to the other trading strategies. There are entire books that go through all the major technical patterns and backtest them and come to the same result: technical analysis is not a good forecasting tool. I explained my philosophy on technical analysis when I discussed

technical analysis. I am talking about recurring price patterns. The more you read and study your market, the more you will learn about, identify and backtest these types of patterns. Here are a few examples: Stocks trade poorly from September 16 to October 9 then rip higher into year end This

Asch, Solomon, 82 Asch Conformity Experiment, 82, 82, 83 Asian Financial Crisis (1998), 441 “Aspen Trading” (newsletter), 492 asymmetrical information, 156, 160 Axelrod, Bobby, 102 backtesting, 81, 221 curiosity and, 89—90 Bank of America, 42 Global Fund Manager Survey, 345 Bank of Canada, 308 bank traders annual performance and pay

—288 Trade at Settlement (TAS) orders, 287 volume by time of day, 288 cryptocurrency, 310—311, 421 curiosity, 35, 89—90 academic performance and, 89 backtesting and, 89—90 as trader attribute, 75, 89-90 cynicism, 103, 259, 454 “Daily Dirtnap, The” (newsletter), 492 Daily FX positioning data, 345 Daily Sentiment

Python for Algorithmic Trading: From Idea to Cloud Deployment

by Yves Hilpisch  · 8 Dec 2020  · 1,082pp  · 87,792 words

from different public data and proprietary data sources. It also demonstrates how to store financial time series data efficiently with Python. Chapter 4, Mastering Vectorized Backtesting Vectorization is a powerful approach in numerical computation in general and for financial analytics in particular. This chapter introduces vectorization with NumPy and pandas and

applies that approach to the backtesting of SMA-based, momentum, and mean-reversion strategies. Chapter 5, Predicting Market Movements with Machine Learning This chapter is dedicated to generating market predictions

’s market direction by using such Python packages as Keras in combination with TensorFlow and scikit-learn. Chapter 6, Building Classes for Event-Based Backtesting While vectorized backtesting has advantages when it comes to conciseness of code and performance, it’s limited with regard to the representation of certain market features of

in their trading operations and constantly look for seasoned Python professionals. This book focuses on applying Python to the different disciplines in algorithmic trading, like backtesting trading strategies or interacting with online trading platforms. It cannot replace a thorough introduction to Python itself nor to trading in general. However, it systematically

the used data, statistics, signals, and performance results. A few lines of Python code are generally enough to generate appealing and insightful plots. Comprehensive backtesting programs Vectorized backtesting is pretty fast in general, allowing one to test a great variety of parameter combinations in a short amount of time. When speed is

timedelta(days=596) Where are the differences equal to zero? Calculates the timedelta values between all index values. Picks out the maximum timedelta value. Vectorized backtesting with pandas is generally a rather efficient endeavor due to the capabilities of the package and the main DataFrame class. However, the interactive approach illustrated

-Reversion Strategies # # Python for Algorithmic Trading # (c) Dr. Yves J. Hilpisch # The Python Quants GmbH # from MomVectorBacktester import * class MRVectorBacktester(MomVectorBacktester): ''' Class for the vectorized backtesting of mean reversion-based trading strategies. Attributes ========== symbol: str RIC symbol with which to work start: str start date for data retrieval end: str end

of-sample, with transaction costs) Applying sophisticated machine learning techniques to stock market prediction often yields promising results early on. In several examples, the strategies backtested outperform the base instrument significantly in-sample. Quite often, such stellar performances are due to a mix of simplifying assumptions and also due to an

implementation standpoint. The basic insights, however, easily carry over to the methods implementing the other two strategies: def run_mean_reversion_strategy(self, SMA, threshold): ''' Backtesting a mean reversion-based strategy. Parameters ========== SMA: int simple moving average in days threshold: float absolute value for deviation-based signal relative to SMA ''' msg

for Algorithmic Trading # (c) Dr. Yves J. Hilpisch # The Python Quants GmbH # from BacktestBase import * class BacktestLongOnly(BacktestBase): def run_sma_strategy(self, SMA1, SMA2): ''' Backtesting an SMA-based strategy. Parameters ========== SMA1, SMA2: int shorter and longer term simple moving average (in days) ''' msg = f'\n\nRunning SMA strategy | SMA1={SMA1

trading strategy for different leverage values Leverage increases risks associated with trading strategies significantly. Traders should read the risk disclaimers and regulations carefully. A positive backtesting performance is also no guarantee whatsoever for future performances. All results shown are illustrative only and are meant to demonstrate the application of programming and

algorithm from machine learning to predict the direction of market movements. It addresses such important topics as capital management (based on the Kelly criterion), vectorized backtesting for performance and risk, the transformation of offline to online trading algorithms, an appropriate infrastructure for deployment, and logging and monitoring during deployment. The topic

this chapter. Automated Trading Strategy The following Python script contains the code for the automated deployment of the ML-based trading strategy, as discussed and backtested in this chapter: # # Automated ML-Based Trading Strategy for Oanda # Online Algorithm, Logging, Monitoring # # Python for Algorithmic Trading # (c) Dr. Yves J. Hilpisch # import

. 1 Note that computers can only generate pseudorandom numbers as approximations for truly random numbers. Index A absolute maximum drawdown, Case Study AdaBoost algorithm, Vectorized Backtesting addition (+) operator, Data Types adjusted return appraisal ratio, Algorithmic Trading algorithmic trading (generally)advantages of, Algorithmic Trading basics, Algorithmic Trading-Algorithmic Trading strategies, Trading Strategies

, Strategies Based on Simple Moving Averages-Generalizing the Approach Python scripts for classification algorithm backtesting, Classification Algorithm Backtesting Class Python scripts for linear regression backtesting class, Linear Regression Backtesting Class vectorized (see vectorized backtesting) BacktestLongShort class, Long-Short Backtesting Class, Long-Short Backtesting Class bar charts, matplotlib bar plots (see Plotly; streaming bar plot) base class, for

Simple Classification Problem-A Simple Classification Problem neural networks for, The Simple Classification Problem Revisited-The Simple Classification Problem Revisited Python scripts for vectorized backtesting, Classification Algorithm Backtesting Class .close_all() method, Placing Orders cloud instances, Using Cloud Instances-Script to Orchestrate the Droplet Set Upinstallation script for Python and Jupyter Lab

Class DataFrame objectscreating, Vectorization with pandas storing, Storing DataFrame Objects-Storing DataFrame Objects dataism, Preface DatetimeIndex() constructor, Plotting with pandas decision tree classification algorithm, Vectorized Backtesting deep learningadding features to analysis, Adding Different Types of Features-Adding Different Types of Features classification problem, The Simple Classification Problem Revisited-The Simple Classification

the Basics-Generalizing the Approach vectorized backtesting of ML-based trading strategy, Vectorized Backtesting-Vectorized Backtesting vectorized backtesting of regression-based strategy, Vectorized Backtesting of Regression-Based Strategy event-based backtesting, Building Classes for Event-Based Backtesting-Long-Short Backtesting Classadvantages, Building Classes for Event-Based Backtesting base class, Backtesting Base Class-Backtesting Base Class, Backtesting Base Class building classes for, Building

Classes for Event-Based Backtesting-Long-Short Backtesting Class long-only backtesting class, Long-Only Backtesting

Class-Long-Only Backtesting Class, Long

-Only Backtesting Class long-short backtesting class, Long

-Short Backtesting Class-Long-Short Backtesting Class, Long-Short Backtesting

Class Python scripts for, Backtesting Base Class

-Long-Short Backtesting Class Excelexporting financial data to, Exporting to Excel

the Basics-Getting into the Basics, Generalizing the Approach-Generalizing the Approach Goldman Sachs, Python and Algorithmic Trading, Algorithmic Trading .go_long() method, Long-Short Backtesting Class H half Kelly criterion, Optimal Leverage Harari, Yuval Noah, Preface HDF5 binary storage library, Using TsTables-Using TsTables HDFStore wrapper, Storing DataFrame Objects-Storing

DataFrame Objects high frequency trading (HFQ), Algorithmic Trading histograms, matplotlib hit ratio, defined, Vectorized Backtesting I if-elif-else control structure, Python Idioms in-sample fitting, Generalizing the Approach index levels, predicting, Predicting Index Levels-Predicting Index Levels infrastructure (see

Direction-Using Logistic Regression to Predict Market Direction Python script for vectorized backtesting, Classification Algorithm Backtesting Class long-only backtesting class, Long-Only Backtesting Class-Long-Only Backtesting Class, Long-Only Backtesting Class long-short backtesting class, Long-Short Backtesting Class-Long-Short Backtesting Class, Long-Short Backtesting Class longest drawdown period, Risk Analysis M machine learningclassification problem, A Simple

Machine Learning for Market Movement Prediction-Generalizing the Approach ML-based trading strategy, ML-Based Trading Strategy-Persisting the Model Object Python scripts, Linear Regression Backtesting Class trading strategies and, Machine and Deep Learning using logistic regression to predict market direction, Using Logistic Regression to Predict Market Direction-Using Logistic Regression

to Predict Market Direction macro hedge funds, algorithmic trading and, Algorithmic Trading __main__ method, Backtesting Base Class margin trading, FX Trading with FXCM market direction prediction, Predicting Future Market Direction market movement predictiondeep learning for, Using Deep Learning for Market

Mean Reversion-Generalizing the Approachbasics, Getting into the Basics-Generalizing the Approach generalizing the approach, Generalizing the Approach Python code with a class for vectorized backtesting, Momentum Backtesting Class Miniconda, Installing Miniconda-Installing Miniconda mkl (Intel Math Kernel Library), Basic Operations with Conda ML-based strategies, ML-Based Trading Strategy-Persisting the

Margin working with streaming data, Working with Streaming Data Oanda v20 RESTful API, The Oanda API, ML-Based Trading Strategy-Persisting the Model Object, Vectorized Backtesting offline algorithmdefined, Signal Generation in Real Time transformation to online algorithm, Online Algorithm OLS (ordinary least squares) regression, matplotlib online algorithmautomated trading operations, Online Algorithm

visualization of streaming data, Visualizing Streaming Data with Plotly-Streaming Data as Bars plotting, with pandas, Plotting with pandas-Plotting with pandas .plot_data() method, Backtesting Base Class polyfit()/polyval() convenience functions, matplotlib price prediction, based on time series data, The Basic Idea for Price Prediction-The Basic Idea for Price

for Bar Plot sample time series data set, Python Scripts strategy monitoring, Strategy Monitoring uploading for automated trading operations, Uploading the Code vectorized backtesting, Python Scripts-Mean Reversion Backtesting Class Q Quandlpremium data sets, Working with Open Data Sources working with open data sources, Working with Open Data Sources-Working with Open

ML-based trading strategy, Risk Analysis-Risk Analysis RSA public/private keys, RSA Public and Private Keys .run_mean_reversion_strategy() method, Long-Only Backtesting Class, Long-Short Backtesting Class .run_simulation() method, Kelly Criterion in Binomial Setting S S&P 500, Algorithmic Trading-Algorithmic Tradinglogistic regression-based strategies and, Generalizing the

Deep Learning mean-reversion, NumPy and Vectorization momentum, Momentum simple moving averages, Simple Moving Averages trading, motives for, Algorithmic Trading transaction costs, Long-Only Backtesting Class, Vectorized Backtesting TsTables package, Using TsTables-Using TsTables tuple objects, Data Structures U Ubuntu, Building a Ubuntu and Python Docker Image-Building a Ubuntu and Python

Image universal functions, NumPy, ndarray Methods and NumPy Functions V v20 wrapper package, The Oanda API, ML-Based Trading Strategy-Persisting the Model Object, Vectorized Backtesting value-at-risk (VAR), Risk Analysis-Risk Analysis vectorization, NumPy and Vectorization, Strategies Based on Mean Reversion-Generalizing the Approach vectorized backtestingdata snooping and overfitting

Beyond Diversification: What Every Investor Needs to Know About Asset Allocation

by Sebastien Page  · 4 Nov 2020  · 367pp  · 97,136 words

equity returns into three components: income, growth, and valuation change. I’m partial to it because my first research project in the industry was to backtest it on data for more than 20 countries. In this, I had help from Mark Kritzman, president and CEO of Windham Capital Management and senior

company, presumably to finance growth projects. It’s finance 101, and again I suppose there’s nothing more practical than a good theory. In my backtests, when I replaced the economic growth model estimates with the sustainable growth rate for each country, the strategy’s performance jumped significantly. I was young

beat the pants off the MSCI World Index, with very limited look-ahead bias. (In hindsight, exceptional backtest performance is never that exceptional. A client once told me that he had never seen a backtest that didn’t work. He added that the only people who can consistently generate Sharpe ratios of

3.0 or above were quants running backtests, plus Bernie Madoff. Even without explicit look-ahead bias, researchers benefit from years of published research on what works and what doesn’t, which is

flows and subsequent valuation changes across countries. Then I applied this beta to recent flows. It worked very well: the first time I ran the backtest with the full forecast of income, growth, and flow-based valuation change, the results improved drastically. They got even better when I introduced the ROE

’s just struck oil. Mark set up the project as a horse race between models. First, he asked me to run a backtest without any return forecast. To run a backtest without return forecasts, I set up the optimizer to solve for the risk-minimizing weights every month. Surprisingly, this approach outperformed

to focus on our process, because too many academics and practitioners explain how to forecast returns or build TAA strategies with sophisticated statistical studies and backtests, yet barely account for real-world, practical considerations. For example, the editors of the Financial Analysts Journal now reject any empirical study that doesn’t

. As practitioners, we sometimes sacrifice “rigor” for simplicity and transparency. We don’t want to overfit historical data, and we obsess over whether factor models, backtests, and other useful statistical analyses are relevant given the current environment and going forward. At its core, our TAA approach is discretionary—it’s not

inflation. DeepMacro scans over 3,000 series, narrows the set to the most 127 most predictive variables, and keeps track of all releases daily. In backtests, DeepMacro data seem more predictive than official GDP and inflation numbers. As of Wednesday last week, the DeepMacro signal is bullish (long stocks). This observation

May 31, 2018. Data fields used are TOT_RETURN_INDEX_GROSS_DVDS, INDX_ADJ_POSITIVE_PE, PX_TO_BOOK_RATIO, and PX_TO_CASH_FLOW. Backtests involving EAFE small start on January 31, 1998, as data are not available going back to 1995. 3. Monthly data from January 1990 to June

follow simple valuation-based strategies, but as we’ll see in Chapter 12, systematic strategies that combine valuation with momentum signals have worked well in backtests and in practice. As for nonsystematic processes, when I described our own approach to TAA, I explained that we look at a variety of factors

contrast with Poon and Granger’s conclusion, Marra’s results reveal that the option- implied approach performed the worst out of the eight models he backtested. Of course, while no single model has surfaced as the most effective, some models perform better than others for specific asset classes and during specific

thick skin and high risk tolerance. What’s the solution? Is there a way to stabilize a portfolio’s risk exposure over time? Managed Volatility Backtests The managed volatility strategy is designed for that purpose. It relies on the short-term predictability in volatility. In a nutshell, the strategy adjusts the

is portable and can easily be applied as a futures overlay to smooth the ride for almost any portfolio.3 Importantly, it has been thoroughly backtested. In Table 7.1, I summarize a sample of 11 studies on the topic.4 TABLE 7.1 Prior Studies on Managed Volatility To compare

results suggest that any asset allocation process can be improved if we incorporate volatility forecasts. But a few caveats apply. Cynics may argue that only backtests that generate interesting results get published (earlier I mentioned publication bias). Authors often make unrealistic assumptions about implementation. For example, they assume portfolio managers can

, duration, or other risk premiums versus the static benchmark. Though these risk-adjusted alphas should be shaved to account for the inevitable implementation shortfall between backtests and reality, managed volatility has been shown in practice to reduce exposure to loss and smooth the ride for investors, at a very low—or

positive—cost in terms of returns. Dreyer and Hubrich (2019) treat cost and implementation carefully, because they are rooted in live portfolio experience. Consider a backtest our team built specifically to represent real-world implementation, based on data from January 1996 to December 2014. For this example, we set a target

for several variations of the methodology. William Fallon, James Park, and Danny Yu, in their 2015 paper “Asset Allocation Implications of the Global Volatility Premium,” backtest volatility risk premium strategies across 11 equity markets, 10 commodities, 9 currencies, and 4 government bond markets. They find that “the volatility risk premium is

on the Volatility Risk Premium The same caveats apply as for the managed volatility studies—namely, that only backtests with good results tend to get published and that authors often ignore implementation shortfall between backtests and realized performance. Nonetheless, in practice, covered call writing has been shown to deliver good risk-adjusted

thing as upside risk? In general, though, it is more difficult to forecast the directionality of volatility than volatility itself. Doing so in managed volatility backtests may not change the forecast that much. We’ll discuss downside risk forecasts in more detail in the next chapter. Q: The volatility risk premium

reported by the authors. MVO refers to mean-variance optimization; TAA refers to tactical asset allocation, expressed as various multi-asset portfolio shifts; all other backtests involve timing exposure to a single market or risk premium. Countries refer to country equity markets, except for Perchet, Carvalho, and Moulin (2014), which includes

value and momentum factors across 10 countries and 10 currencies. Some backtests in Fleming, Kirby, and Ostdiek (2001) and Perchet, Carvalho, and Moulin (2014) involve shorter time series because of the lack of available data. The

backtest by Dopfel and Ramkumar (2013) is in-sample. The regime-switching model in Kritzman, Page, and Turkington (2012) combines turbulence, GDP, and inflation regimes. Regarding

500. Fallon, Park, and Yu’s start dates vary from January 1995 to February 2001 based on data availability, and alpha is averaged across all backtests. 9. All data sources and methodologies from this section are described in “Return of the Quants,” CFA Institute Conference Proceedings, Third Quarter 2016. 10. These

usually say that “the strategy is so simple, a monkey could do it,” which is only a slight overstatement. Despite its simplicity, in Lo’s backtest, the mystery strategy doubles the Sharpe ratio of the S&P 500, from 0.98 to 1.94. And from January 1992 to December 1999

just need to temper their expectations. Good results are achievable in practice, but for due diligence purposes, they should require live track records rather than backtests. Covered call writing, which we discussed in Chapter 7,5 is a strategy that delivers another risk premium with sound theoretical foundations and persistence over

way to measure value—can be added to style premium strategies to capitalize on the predictive power of yields that we discussed in Chapter 2. Backtest Buyer Beware Risk premium strategies are too easy to build. It has been estimated that there are at least 300 published factors, with roughly 40

trap of data mining/overfitting. And when they don’t, they most likely rely on prior studies that were data-mined.7 Out-of-sample backtests are never truly out-of-sample, because researchers can look at simulated results and tweak their models to improve performance. Even if model inputs rely

”? In such a world, we’d see as many realized Sharpe ratios of 1.5 as we see in paper backtests. To be fair, it can be useful to look at backtest data to improve a model, if we have a good reason to believe the improvement is going to work in

deterioration to data mining and the remaining 32% to crowding, or “publication-informed trading.” They also raise two other red flags related to risk premium backtests: postpublication declines are greater for predictors with higher in-sample returns, and returns are higher for portfolios concentrated in stocks with high idiosyncratic risk and

handful of robust strategies. These risk premiums provide access to long-short portfolios and dynamic, uncorrelated sources of returns. But if someone shows you a backtest, don’t buy all the hype. Ask for a live track record and the theoretical foundations behind the risk premiums, as well as an analysis

minimization, without forecasting skill, outperformed the market capitalization–weighted benchmark. In “In Defense of Optimization,” we find similar results across a much broader range of backtests. Again, the takeaway is that without any return forecasts (which is better than with poor return forecasts), optimization performs remarkably well. This result is due

, irrespective of where and how it is implemented. Others believe that risk parity is a fad fueled by misleading interpretations of finance theory and dubious backtests. The debate reached a critical point a few years ago with the publication of an article by Robert Anderson, Stephen Bianchi, and Lisa Goldberg (2012

) in the Financial Analysts Journal, titled “Will My Risk Parity Strategy Outperform?” The authors showed that over an 80-year backtest, risk parity underperforms the 60% equities/40% bonds portfolio, after accounting for the historical cost of leverage and turnover. The response by proponents of risk

parity was thoughtful and quite clear. Anderson, Bianchi, and Goldberg’s backtest of risk parity was misleading because it misrepresented how the approach is implemented in practice. Ultimately, our industry seems to have reached the “Let’s

investors.) Q: Does risk parity ignore liabilities? A: The approach can be easily adjusted to account for liabilities and funded ratios. Unfortunately, across all his backtests and examples, Qian does not address one of the most important issues: the critique by Anderson, Bianchi, and Goldberg regarding the cost of leverage and

transaction costs. In the current low-rate environment, the cost of borrowing is extremely low. But for backtests that go back 40+ years, he should adjust for historical LIBOR rates that were as high as 9+%. Qian does not provide his assumptions on

dragged down with it for no good fundamental reason. Our goal is merely to estimate the size of the opportunity, because it’s impossible to backtest a discretionary, fundamental approach. Cahan, Bai, and Yang (2018) suggest that most ETF investors ignore the fundamentals of the underlying constituents.2 The authors refer

to be a good way to identify outsiders. These correlation abnormalities can create a plethora of buying opportunities at the security level. To illustrate, we backtest a simple systematic strategy. For each volume spike accompanied by a negative return, we systematically buy the outsiders and hold them for 40 days. We

risk factor models to assess portfolio diversification, forecast risk, and enhance scenarios. 3. Consider risk premiums as possible small stand-alone investments, but beware of backtest results. 4. Solve this question first: What stock-bond mix matches the investor’s goals and risk tolerance? 5. Use portfolio optimization models, judgment, and

medical system and thereby impact medical equipment providers. However, these stocks’ reaction still seems exaggerated. 11. Throughout this research project, including in the 2010–2017 backtest, transaction costs were estimated at 10 bps, or 17 bps considering leverage (on average). Borrowing costs were based on LIBOR + 50 bps and depend on

individual classes) Asset weights: fixed, 95 in market portfolio, 17–19 in portfolio optimization, 201, 207–209 Austin, Maureen, 218–219 Average yield, 40–42 Backtests: exceptional, 30 managed volatility, 95–101 of risk parity, 213 for risk premiums, 182–184 of volatility risk premium strategies, 103 without return forecasts, 32

in stock picking, 240–241 “Macroeconomic Dashboards for Tactical Asset Allocation” (Clewell et al.), 62 Madhavan, Ananth, 236 Mahalanobis distance, 205 Managed volatility, 93–94 backtesting of, 95–101 and buy and hold strategy, 99–100, 105 combined with covered call writing, 104, 105 and currency hedging, 108 and failure of

managed volatility vs., 105–106 in portfolio optimization, 212–215 Risk Parity Fundamentals (Qian), 213–214 Risk predictability tests, 112–119 Risk premiums, 179–184 backtest data for, 182–184 beta, 179–180 for bonds, 40 and currency carry trade, 131 diversification across, 182 low-risk anomaly, 180–181 and risk

, 154–157, 168, 204 Risk tolerance, 149–150 Risk-based investing, 93–109 combination of strategies for, 104 covered call writing, 102–104 managed volatility backtests, 95–101 Q&A about, 105–109 (See also Managed volatility) Risk-free rate, 11 Roll, Richard, 62, 67 Roll down, 40–41 Ross, Stephen

Advances in Financial Machine Learning

by Marcos Lopez de Prado  · 2 Feb 2018  · 571pp  · 105,054 words

9.2 Grid Search Cross-Validation 9.3 Randomized Search Cross-Validation 9.4 Scoring and Hyper-parameter Tuning Exercises References Bibliography Notes PART 3 BACKTESTING Chapter 10 Bet Sizing 10.1 Motivation 10.2 Strategy-Independent Bet Sizing Approaches 10.3 Bet Sizing from Predicted Probabilities 10.4 Averaging

always backfires, because each PhD will frantically search for investment opportunities and eventually settle for (1) a false positive that looks great in an overfit backtest or (2) standard factor investing, which is an overcrowded strategy with a low Sharpe ratio, but at least has academic support. Both outcomes will

investment strategy as to produce a hundred, and the complexities are overwhelming: data curation and processing, HPC infrastructure, software development, feature analysis, execution simulators, backtesting, etc. Even if the firm provides you with shared services in those areas, you are like a worker at a BMW factory who has been

1.2 Common Pitfalls in Financial ML # Category Pitfall Solution Chapter 1 Epistemological The Sisyphus paradigm The meta-strategy paradigm 1 2 Epistemological Research through backtesting Feature importance analysis 8 3 Data processing Chronological sampling The volume clock 2 4 Data processing Integer differentiation Fractional differentiation 5 5 Classification Fixed-time

and so on, there are many shared generic problems you will face: data structuring, labeling, weighting, stationary transformations, cross-validation, feature selection, feature importance, overfitting, backtesting, etc. In the context of financial modeling, answering these questions is non-trivial, and framework-specific approaches need to be developed. That is the focus

another chapter for labeling of financial series, another for sample weighting, time series differentiation, . . . all the way to a full part devoted to the proper backtesting of investment strategies. To be sure, there are a handful of prior publications (mostly journal articles) that have applied standard ML to financial series, but

accuracy we would achieve by tossing a fair coin. In finance, CV is typically used in two settings: model development (like hyper-parameter tuning) and backtesting. Backtesting is a complex subject that we will discuss thoroughly in Chapters 10–16. In this chapter, we will focus on CV for model development. 7

In general, we need to purge and embargo overlapping training observations whenever we produce a train/test split, whether it is for hyper-parameter fitting, backtesting, or performance evaluation. Snippet 7.3 extends scikit-learn's KFold class to account for the possibility of leakages of testing information into the training

is that so many very seasoned portfolio managers (including many with a quantitative background) do not realize how easy it is to overfit a backtest. How to backtest properly is not the subject of this chapter; we will address that extremely important topic in Chapters 11–15. The goal of this chapter

Wang, J. Jussa, A. Wang, and G. Rohal (2014): “Seven sins of quantitative investing.” White paper, Deutsche Bank Markets Research, September 8. Sarfati, O. (2015): “Backtesting: A practitioner's guide to assessing strategies and avoiding pitfalls.” Citi Equity Derivatives. CBOE 2015 Risk Management Conference. Available at https://www.cboe.com/rmc

Available at https://ssrn.com/abstract=2731886. Bailey, D., J. Borwein, M. López de Prado, and J. Zhu (2017b): “Mathematical appendices to: ‘The probability of backtest overfitting.’” Journal of Computational Finance (Risk Journals), Vol. 20, No. 4. Available at https://ssrn.com/abstract=2568435. Bailey, D., J. Borwein, A. Salehipour, and

No. 1, pp. 99–109. Available at https://ssrn.com/abstract=2003638. Carr, P. and M. López de Prado (2014): “Determining optimal trading rules without backtesting.” Working paper. Available at https://ssrn.com/abstract=2658641. López de Prado, M. (2012a): “Portfolio oversight: An evolutionary approach.” Lecture at Cornell University. Available at

finance.” Journal of Portfolio Management, Vol. 41, No. 4, pp. 140–144. Available at https://ssrn.com/abstract=2609734. López de Prado, M. (2015c): “Backtesting.” Lecture at Cornell University. Available at https://ssrn. com/abstract=2606462. López de Prado, M. (2015d): “Recent trends in empirical finance.” Journal of Portfolio Management

methods, namely that those schemes test a single path. I call it the “combinatorial purged cross-validation” (CPCV) method. Given a number φ of backtest paths targeted by the researcher, CPCV generates the precise number of combinations of training/testing sets needed to generate those paths, while purging training observations

process. Because the derivation of such trading strategy is not the result of a historical simulation, our procedure avoids the risks associated with overfitting the backtest to a single path. Instead, the optimal trading rule is derived from the characteristics of the underlying stochastic process that drives prices. The same

://ssrn.com/abstract=2201302. Bailey, D., J. Borwein, M. López de Prado, and J. Zhu (2014): “Pseudo-mathematics and financial charlatanism: The effects of backtest overfitting on out-of-sample performance.” Notices of the American Mathematical Society, 61(5), pp. 458–471. Available at http://ssrn.com/ abstract=2308659. Bailey

Investment Performance Standards (GIPS),1 however a comprehensive analysis of performance requires metrics specific to the ML strategies under scrutiny. 14.2 Types of Backtest Statistics Backtest statistics comprise metrics used by investors to assess and compare various investment strategies. They should help us uncover potentially problematic aspects of the strategy,

, implementation shortfall, return/risk efficiency, classification scores, and attribution. 14.3 General Characteristics The following statistics inform us about the general characteristics of the backtest: Time range: Time range specifies the start and end dates. The period used to test the strategy should be sufficiently long to include a comprehensive

Some useful performance measurements include: PnL: The total amount of dollars (or the equivalent in the currency of denomination) generated over the entirety of the backtest, including liquidation costs from the terminal position. PnL from long positions: The portion of the PnL dollars that was generated exclusively by long positions. This

/committees/ethics/index.html. Bailey, D., J. Borwein, M. López de Prado, and J. Zhu (2014): “Pseudo-mathematics and financial charlatanism: The effects of backtest overfitting on out-of-sample performance.” Notices of the American Mathematical Society, Vol. 61, No. 5. Available at http://ssrn.com/abstract= 2308659. Bailey, D

2013): “. . . And the cross-section of expected returns.” Working paper, Duke University. Available at http://ssrn.com/abstract=2249314. Harvey, C. and Y. Liu (2014): “Backtesting.” Working paper, Duke University. Available at http://ssrn.com/abstract=2345489. Hochberg Y. and A. Tamhane (1987): Multiple Comparison Procedures, 1st ed. John Wiley and

. 458–471. Available at http://ssrn.com/abstract=2308659. Bailey, D. and M. López de Prado (2014): “The deflated Sharpe ratio: Correcting for selection bias, backtest overfitting and non-normality.” Journal of Portfolio Management, Vol. 40, No. 5, pp. 94–107. Black, F. and R. Litterman (1992): “Global portfolio optimization.”

binary classification problems and measurement of AdaBoost implementation Adaptable I/O System (ADIOS) Alternative data Amihud's lambda Analytics Annualized Sharpe ratio Annualized turnover, in backtesting Asset allocation classical areas of mathematics used in covariance matrix in diversification in Markowitz's approach to Monte Carlo simulations for numerical example of practical

tree clustering approaches to Attribution Augmented Dickey-Fuller (ADF) test. See also Supremum augmented Dickey-Fuller (SADF) test Average holding period, in backtesting Average slippage per turnover Backfilled data Backtesters Backtesting bet sizing in common errors in combinatorial purged cross-validation (CPCV) method in cross-validation (CV) for customization of definition of “false

allocation and purpose of as research tool strategy risk and strategy selection in synthetic data in uses of results of walk-forward (WF) method of Backtest overfitting backtesters’ evaluation of probability of bagging to reduce combinatorial purged cross-validation (CPCV) method for concerns about risk of cross-validation (CV) method and decision

attribution and predicted probabilities and runs and increase in size discretization in strategy-independent approaches to strategy's capacity and Bet timing, deriving Betting frequency backtesting and computing implied precision computation and investment strategy with trade-off between precision and strategy risk and targeting Sharpe ratio for trade size and Bias

bias reduction using Bootstrap aggregation. See Bagging Bootstraps, sequential Box-Jenkins analysis Broker fees per turnover Brown-Durbin-Evans CUSUM test Cancellation rates Capacity, in backtesting Chow-type Dickey-Fuller test Chu-Stinchcombe-White CUSUM test Classification models Classification problems class weights for underrepresented labels in generating synthetic dataset for meta

using functionality for handling underrepresented label correction using Cloud systems Combinatorially symmetric cross-validation (CSCV) method Combinatorial purged cross-validation (CPCV) method algorithm steps in backtest overfitting and combinatorial splits in definition of examples of Compressed markets Computational Intelligence and Forecasting Technologies (CIFT) project Adaptable I/O System (ADIOS) and business

applications developed by Flash Crash of 2010 response and mission of Conditional augmented Dickey-Fuller (CADF) test Correlation to underlying, in backtesting Corwin-Schultz algorithm Critical Line Algorithm (CLA) description of Markowitz's development of Monte Carlo simulations using numerical example with open-source implementation of practical

problems with Cross-entropy loss (log loss) scoring Cross-validation (CV) backtesting through combinatorial purged cross-validation (CPCV) method in embargo on training observations in failures in finance using goal of hyper-parameter tuning with k-fold

multiprocessing and objective function and pattern-finding capability in software for streaming data analysis using supernova hunting using use cases for vectorization and Holding periods backtesting and bet sizing and estimating in strategy optimal trading rule (OTR) algorithm with triple-period labeling method and Hyper-parameter tuning grid search cross-

CV) Leakage reduction bagging for purging process in training set for sequential bootstraps for walk-forward timefolds method for Lempel-Ziv (LZ) estimator Leverage, in backtesting Limit prices, in bet sizing Log loss scoring, in hyper-parameter tuning Log-uniform distribution Look-ahead bias Machine learning (ML) finance and financial machine

Carlo simulations for numerical example of quasi-diagonalization in recursive bisection in tree clustering approaches to Market data Markowitz, Harry Maximum dollar position size, in backtesting Maximum likelihood estimator, in entropy Mean decrease accuracy (MDA) feature importance computed on synthetic dataset considerations in working with implementation of single feature importance (

(VPIN) and Mixture of Gaussians (EF3M) Model development cross-validation (CV) for overfitting reduction and single feature importance method and Modelling applications of entropy to backtesting in cross-validation in econometrics and ensemble methods in entropy features in feature importance in hyper-parameter tuning with cross-validation in market microstructure theories

data for determination of Options markets Ornstein-Uhlenbeck (O-U) process Orthogonal features benefits of computation of implementation of Outliers, in quantitative investing Overfitting. See Backtest overfitting Parallelized feature importance PCA (see Principal components analysis) Performance attribution Plotting function for feature importance PnL (mark-to-market profits and losses) ETF trick

hedging weights using linear substitution effects and Probabilistic Sharpe ratio (PSR) calculation of as efficiency statistic probability of strategy failure, similarity to Probability of backtest overfitting (PBO) backtest overfitting evaluation using combinatorially symmetric cross-validation (CSCV) method for strategy selection based on estimation of Probability of informed trading (PIN) Probability of strategy

validation (CV) grid search cross-validation and hyper-parameter tuning with implementation of randomized search cross-validation and Python Quantamental approach Quantamental funds Quantitative investing backtest overfitting in failure rate in meta-strategy paradigm in quantamental approach in seven sins of Quantum computing Random forest (RF) method alternative ways of setting

costs Returns concentration RF. See Random forest (RF) method Right-tail unit-root tests Risk. See also Hierarchical Risk Parity (HRP) approach; Strategy risk backtest statistics for uncovering entropy application to portfolio concentration and liquidity and ML algorithms for monitoring PCA weights and portfolio oversight and profit taking and stop

tests Supernova research Support vector machines (SVMs) Supremum augmented Dickey-Fuller (SADF) test conditional ADF implementation of quantile ADF Survivorship bias SymPy Live Synthetic data backtesting using experimental results using simulation combinations with optimal trading rule (OTR) framework using Tick bars Tick imbalance bars (TIBs) Tick rule Tick runs bars (TRBs

) Time bars description of fixed-time horizon labeling method using Time-decay factors, and sample weights Time period, in backtesting Time series fractional differentiation applied to integer transformation for stationarity in stationarity vs. memory loss dilemma in Time under water (TuW) definition of deriving example

RF) method for Vectorization Volume bars Volume imbalance bars (VIBs) Volume runs bars (VRBs) Volume-synchronized probability of informed trading (VPIN) Walk-forward (WF) method backtesting using overfitting in pitfalls of Sharpe ratio estimation in two key advantages of Walk-forward timefolds method Weighted Kendall's tau Weights. See Class weights

Quantitative Trading: How to Build Your Own Algorithmic Trading Business

by Ernie Chan  · 17 Nov 2008

addresses how to: How to Build Your Own Algorithmic Trading Business • Find a viable trading strategy that you’re both comfortable with and confident in • Backtest your strategy—with MATLAB ®, Excel, and other platforms—to ensure good historical performance • Build and implement an automated trading system to execute your strategy • Scale

Split and Dividend Adjusted? 36 Are the Data Survivorship Bias Free? 40 Does Your Strategy Use High and Low Data? 42 Performance Measurement 43 Common Backtesting Pitfalls to Avoid 50 Look-Ahead Bias 51 Data-Snooping Bias 52 Transaction Costs 60 Strategy Refinement 65 Summary 66 CHAPTER 4 Setting Up Your

by institutional traders in this arena. However, can an independent, retail trader benefit from these algorithms? Can an individual with limited resources and computing power backtest and execute their strategies over thousands of stocks, and come to challenge the powerful industry participants in their own game? I will show you how

tool is called MATLAB®, and it is a mathematical platform that many institutional quantitative strategists and portfolio managers use. Therefore, I will demonstrate how to backtest the majority of strategies using MATLAB. In fact, I have included a brief tutorial in the appendix on how to do some basic programming in

MATLAB. For many retail traders, MATLAB is too expensive to purchase, but there are cheaper alternatives, which I will mention in Chapter 3 on backtesting. Furthermore, many university students can either purchase a cheaper student MATLAB license or they already have free access to it through their schools. WHAT WILL

steps that traders need to undertake to set up their quantitative trading business. These steps begin at finding a viable trading strategy (Chapter 2), then backtesting the strategy to ensure that it at least has good historical performance (Chapter 3), setting up the business and technological infrastructure (Chapter 4), building an

, and an architect. Some of them have received advanced technical training, but others have only basic familiarity of high school–level statistics. Most of them backtest their strategies using basic tools like Excel, though others may hire programming contractors to help. Most of them have at some point in their career

time, accessible to anyone at little or no cost. Many authors of these trading ideas will tell you their complete methodologies in addition to their backtest results. There are finance and investment books, newspapers and magazines, mainstream media web sites, academic papers available online or in the nearest public library, trader

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 T 9 P1: JYS c02 JWBK321-Chan September 24, 2008 13:47 Printer: Yet to

historical stock data without survivorship bias are much more expensive than those that have such a bias. Yet if your data have survivorship bias, the backtest result can be unreliable. The same consideration applies to news—whether you can afford a high-coverage, real-time news source such as Bloomberg determines

AND THEIR PITFALLS Now, let’s suppose that you have read about several potential strategies that fit your personal requirements. Presumably, someone else has done backtests on these strategies and reported that they have great historical returns. Before proceeding to devote your time to P1: JYS c02 JWBK321-Chan September 24

funds running quantitative strategies then. Also, 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. The

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

financial predictive models based on many of these AI algorithms in the past. Every time a carefully constructed model that seems to work marvels in backtest came up, they inevitably performed miserably going forward. The main reason for this seems to be that the amount of statistically independent financial data is

in the past. Even if you found a strategy described in complete detail with all the historical performance data available, you would still need to backtest it yourself. This exercise serves several purposes. If nothing else, this replication of the research will ensure that you have understood the strategy completely and

ensures that the original research did not commit any of the common errors plaguing this process. But more than just performing due diligence, doing the backtest yourself allows you to experiment with variations of the original strategy, thereby refining and improving the strategy. In this chapter, I will describe the common

WYSIWYG) because you can easily align the dates with the various data columns and signals on a spreadsheet. Another advantage of Excel is that often backtesting and live trade generation can be done from the same spreadsheet, eliminating any duplication of programming efforts. The major disadvantage of Excel is that it

if their trading algorithms involve some sophisticated but common mathematical concepts. P1: JYS c03 JWBK321-Chan September 24, 2008 13:52 Printer: Yet to come Backtesting 33 (A good example is principal component analysis—often used in factor models in statistical arbitrage trading, and a hassle to implement in other programming

is a continuation of the above MATLAB % code. % cumulative compounded returns P1: JYS c03 JWBK321-Chan September 24, 2008 13:52 Printer: Yet to come Backtesting 49 cumret=cumprod(1+netRet)-1;plot(cumret); [maxDrawdown maxDrawdownDuration]=... calculateMaxDD(cumret); [maxDrawdown maxDrawdownDuration]=... calculateMaxDD(cumret); % maximum drawdown. Output should be 0.1053 maxDrawdown % maximum

0 200 400 600 800 Days 1000 1200 1400 1600 FIGURE 3.1 Maximum drawdown and maximum drawdown duration for Example 3.4 COMMON BACKTESTING PITFALLS TO AVOID Backtesting is the process of creating the historical trades given the historical information available at that time, and then finding out what the subsequent

close, whether to hold the positions overnight, whether to trade large-cap or mid-cap stocks. Often, these qualitative decisions are made to optimize the backtest performance, but they may not be optimal going forward. It is almost impossible to completely eliminate datasnooping bias as long as we are building data

parameterless trading model is that it minimizes the danger of overfitting the model to multiple input parameters (the so-called “data-snooping bias”). So the backtest performance should be much closer to the actual forward performance. (Note that parameter optimization does not necessarily mean picking one best set of parameters that

cell arrays and % then into numeric format. tday2=str2double(cellstr(tday2)); P1: JYS c03 JWBK321-Chan September 24, 2008 13:52 Printer: Yet to come Backtesting % the last column contains the adjusted close prices. adjcls2=num(:, end); % find the intersection of the two data sets, % and sort them in ascending order

incorporating transaction costs. I discussed the various types of transactions costs P1: JYS c03 JWBK321-Chan September 24, 2008 13:52 Printer: Yet to come Backtesting 61 (commission, liquidity cost, opportunity cost, market impact, and slippage) in Chapter 2 and have given examples of how to incorporate transaction costs into the

)); vol(idxtB, s)=myvol(idxA(idxtA)); end save(outputFile, ‘tday’, ‘stocks’, ‘op’, ‘hi’, ... ‘lo’, ‘cl’, ‘vol’); Next, we can use this historical data set to backtest the mean-reverting strategy without transaction cost: clear; startDate=20060101; endDate=20061231; load(‘SPX 20071123’, ‘tday’, ‘stocks’, ‘cl’); % daily returns dailyret=(cl-lag1(cl))./lag1

with transaction costs deducted onewaytcost=0.0005; % assume 5 basis points P1: JYS c03 JWBK321-Chan September 24, 2008 13:52 Printer: Yet to come Backtesting 65 % remove weights outside of our dates of interest weights(tday < startDate | tday > endDate, :) = []; % transaction costs are only incurred when % the weights change dailypnlminustcost=... dailypnl

.19 sharpeminustcost=... sqrt(252)*smartmean(dailypnlminustcost, 1)/... smartstd(dailypnlminustcost, 1) The strategy is now very unprofitable! STRATEGY REFINEMENT If a strategy does not deliver superb backtest performance on first trial, there are some common ways to improve it. How to refine a strategy without introducing data-snooping bias and to remain

pursue a rather mathematically complex strategy based on principal component analysis (such as the one in Example 7.4), it would be quite difficult to backtest in TradeStation. More advanced integrated trading platforms such as Alphacet’s Discovery do P1: JYS c05 JWBK321-Chan 86 September 24, 2008 13:55 Printer

: Yet to come QUANTITATIVE TRADING provide a much larger variety of algorithms to be backtested and implemented, but they may not be affordable to the typical independent trader. HIRING A PROGRAMMING CONSULTANT Building an ATS generally requires more professional programming

skills than backtesting a strategy. This is especially true for high-frequency strategies where the speed of execution is of the essence. Instead of implementing an execution system

the Stat Arb Profits Gone?” in January 2008. Other industry practitioners have made the same point to me in private conversations.) Hence, we can expect backtest performance of statistical arbitrage strategies prior to 2001 to be far superior to their present-day performance. The other regime shift is relevant if your

show an artificially inflated performance prior to 2007 relative to their actual realizable performance in those days. Actually, there is another problem with realizing the backtest performance of a strategy that shorts stocks apart from this regulatory regime shift. Even without the plus-tick rule, many stocks, especially the small-cap

: P1: JYS c05 JWBK321-Chan September 24, 2008 Execution Systems 13:55 Printer: Yet to come 93 r It ensures the faithful adherence to your backtested strategy. r It eliminates manual operation so that you can simultaneously run multiple strategies. r Most importantly, it allows speedy transmissions of orders, which is

about P&L volatility, capital usage, portfolio size, and trade frequency. Finally, what do you do in the situation where your live trading underperforms your backtest? You can start by addressing the usual P1: JYS c05 JWBK321-Chan 94 September 24, 2008 13:55 Printer: Yet to come QUANTITATIVE TRADING problems

108 QUANTITATIVE TRADING Software risk refers to the case where the automated trading system that generates trades every day actually does not faithfully reflect your backtest model. This happens because of the omnipresent software bugs. I discussed the way to eliminate such software errors in Chapter 5: you should compare the

, and it is up to you, the trader, to find those special circumstances when it is strong and consistent. Though mean reversion is quite prevalent, backtesting a profitable mean-reverting strategy can be quite perilous. Many historical financial databases contain errors in price quotes. Any such error tends to artificially inflate

enabled this discovery process to be done in a matter of hours. I shall employ a tool here called Alphacet Discovery, which is an integrated backtesting and execution platform recently launched by Alphacet, Inc. (www.alphacet.com. Full disclosure: Alphacet is a client of my firm.) This platform not only integrates

all historical and real-time data needed for rapid strategy prototyping, backtesting, analysis, and real-time deployment; it also contains an expanding array of machine learning programs such as neural networks and genetic algorithms that are well

losses are not likely, nor are contagious losses across multiple accounts. Though successful high-frequency strategies have such numerous merits, it is not easy to backtest such strategies when the average holding period decreases to minutes or even seconds. Transaction costs are of paramount importance in testing such strategies. Without incorporating

to note can be summarized here: r Mean-reverting regimes are more prevalent than trending regimes. r There are some tricky data issues involved with backtesting mean-reversion strategies: Outlier quotes and survivorship bias are among them. r Trending regimes are usually triggered by the diffusion of new information, the execution

trading strategies typically generate the highest long-term compounded growth due to their high Sharpe ratios. r High-frequency trading strategies are very difficult to backtest and very technology reliant for their execution. r Holding a highly leveraged portfolio of low-beta stocks should generate higher long-term compounded growth than

Sharpe ratios, they do enormously improve your capacity. For many of these strategies, you probably have to invest in expensive historical fundamental data for your backtest. If you are an equity trader, you can branch out into futures or currencies, which typically have higher capacities than equity models. If you run

ATLAB is a general-purpose software package developed by Mathworks, Inc., which is used by many institutional quantitative researchers and traders as their platform for backtesting, particularly those that work in statistical arbitrage. In Chapter 3, I introduced this platform and compared its pros and cons with some other alternatives. Most

academic, 10 financial web sites and blogs, 10 trader forums, 10 newspapers and magazines, 10 Printer: Yet to come 181 TradingMarkets, 10 Transaction costs in backtesting, 61–65 mean-reverting model with and without transaction costs, 61–65 effect on strategy, 22–23 importance in testing high-frequency strategies, 152 minimizing

addresses how to: How to Build Your Own Algorithmic Trading Business • Find a viable trading strategy that you’re both comfortable with and confident in • Backtest your strategy—with MATLAB ®, Excel, and other platforms—to ensure good historical performance • Build and implement an automated trading system to execute your strategy • Scale

Handbook of Modeling High-Frequency Data in Finance

by Frederi G. Viens, Maria C. Mariani and Ionut Florescu  · 20 Dec 2011  · 443pp  · 51,804 words

.3 7.4 7.5 7.6 Introduction, 163 The Skewed t Distributions, 165 Risk Forecasts on a Fixed Timescale, 176 Multiple Timescale Forecasts, 185 Backtesting, 188 Further Analysis: Long-Term GARCH and Comparisons using Simulated Data, 203 7.7 Conclusion, 216 References, 217 8 Parameter Estimation and Calibration for Long

methods to automated trading and several other business problems such as credit risk, direct marketing, fraud detection, and price forecasting. Automated trading systems include a backtest or simulation module. In this respect, agent-based models could be useful to explore new ideas without risking any money.11 The Santa Fe stock

using high frequency data to forecast risk on a lower frequency horizon, using the generalized autoregressive conditionally heteroskedastic (GARCH) methodology. The method proves viable through backtesting in Section 7.5, which includes multiple-day and monthly VaR forecasts, as well as some experiments with high frequency intraday data. Section 7.6

i=r i (1 − α)i α M−i . Choose r, s so that this probability is close to the desired confidence level. 7.5 Backtesting GARCH plays dual roles in the high–low frequency approach. First, it removes serial dependence in historical data so that the maximum likelihood method is

frequency back to the low frequency. Being an effective filter10 does not necessarily ensure being a good simulation mechanism. We must justify its validity through backtests. 7.5.1 INDEPENDENCE OF VIOLATION INDICATORS Define indicator variables α = 1{n It+1 i=1 Xt+i  > VaRα ( ni=1 Xt+i |

, . . . , Zt+n ). i=1 10 As illustrated in Figs. 7.1 and 7.2. Hu and Kercheval (2007) also provided favorable evidence. 189 7.5 Backtesting Similarly, the conditional VaR can be expressed as VaRα n  = g(μ0 , σt+1 , Z (1) , . . . , Z (n) ).11 Xt+i |Ft i=1

, that is, j ≥ n, these i.i.d. innovations will α α and It+j+1 are independent. ensure that It+1 7.5.2 BACKTEST ALGORITHM Given a data set of N daily negative log returns {X1 , . . . , XN }, suppose our target time horizon is n days and the sample

size for skewed t calibration is C. Use the following algorithm for backtest. ALGORITHM 7.20 Backtest For t = C, C + n, C + 2n, . . . , C + kn, . . . 1. Apply GARCH filter to {Xt−C +1 , . . . , Xt } and calibrate the skewed t

statistic for testing H0 : θ ∈ 0 versus H1 : θ ∈ c0 is sup0 L(θ|x) . λ(x) = sup L(θ|x) 191 7.5 Backtesting To understand the rationale behind the LRT, consider a sample of discrete r.v.s, in which case the likelihood function is the product of

H0 , as n → ∞, −2 log λ(x) → χ 2 (1) in distribution. Proof . See Casella and Berger (2002). Recall that we did a sequence of backtests by counting VaR violations. Suppose there are altogether Y tests, and let y denote the number of total violations. The actual violation frequency is y

probability, q, should be 0.05, 0.025, 0.01, and 0.005. 192 CHAPTER 7 Risk Forecasting with Multiple Timescales We then evaluate the backtest results with the likelihood ratio test12 based on Theorem 7.24:  H0 : The expected violation ratio = q, H1 : The expected violation ratio = q. Under the

+ y log(q)] + 2[(Y − y) log(1 − y/Y ) + y log(y/Y )], which is asymptotically χ 2 (1) distributed. The stepsize of the backtest algorithm is set as n to ensure the independence of violation indicators. As a result, the number of tests that can be done on a

fixed amount of daily data will shrink substantially when the time horizon increases. To extract more information on the violations, we can implement the backtest algorithm n times, each with a different starting point in the time index (i.e., t = C, C + 1, . . . , C + n − 1). Each of

the n backtests will contain the same total number of tests Y , but a different number of violations y1 , . . . , yn . 7.5.4 n-DAY HORIZON We list

the actual violation ratios and the corresponding p-values of the likelihood ratio test (LRT) in Tables 7.4–7.13. All VaR backtesting is based on S&P500 daily close prices from January 1, 1991, to December 31, 2009. A thousand samples are used to calibrate each skewed

t distribution. Depending on the length of the time horizon, the total number of backtests ranges between 500 and 1900. For an n-day horizon, we have n groups of results representing different starting points in the time index. From

as described by Casella and Berger (2002). 13 We reject the null hypothesis when the p-value is <0.05. 193 7.5 Backtesting TABLE 7.5 Backtest Results: Three Days Violation Ratio q Group 1 Group 2 Group 3 0.05 0.057 0.054 0.052 0.025 0.027

0.663 0.143 0.921 0.01 0.513 0.239 0.513 0.005 0.175 0.091 0.313 TABLE 7.6 Backtest Results: Four Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 0.05 0.055 0.041 0.052 0.053 0

0.048 0.01 0.624 0.426 0.426 0.006 0.005 0.730 0.574 0.902 0.170 TABLE 7.7 Backtest Results: Five Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 0.05 0.045 0.053 0.046 0

0.317 0.612 0.876 0.136 0.612 0.005 0.913 0.293 0.293 0.059 0.913 TABLE 7.8 Backtest Results: Six Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 0.05 0.052 0.049 0

0.005 0.645 0.336 0.336 0.061 0.645 0.645 194 CHAPTER 7 Risk Forecasting with Multiple Timescales TABLE 7.9 Backtest Results: Seven Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 0.05 0.043 0

0.075 0.799 0.257 0.005 0.459 0.857 0.654 0.857 0.029 0.459 0.857 TABLE 7.10 Backtest Results: Eight Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 0.05 0

0.325 0.394 0.005 0.689 0.689 0.809 0.689 0.809 0.689 0.331 0.809 TABLE 7.11 Backtest Results: Nine Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group 9 0

921 0.005 0.944 0.944 0.944 0.396 0.944 0.243 0.028 0.243 0.396 195 7.5 Backtesting TABLE 7.12 Backtest Results: 10 Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group

0.005 0.456 0.456 0.017 0.456 0.937 0.456 0.456 0.937 0.456 0.937 TABLE 7.13 Backtest Results: 15 Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group 9 Group

horizon stretches, we are ignoring more and more new information, leading to deteriorating GARCH performance. 7.5.5 A VARIANT BACKTEST: FORECASTING A ONE-DAY RETURN, n DAYS AHEAD  The backtest above evaluates the accuracy of the simulated sum ni=1 Xt+i as a whole. To further examine each term inside

holidays, each year typically has 260 trading days and thereby 260/12 = 21.7 days each month on average. We will TABLE 7.14 Alternative Backtest Results: Two Days Violation Ratio q Group 1 Group 2 0.05 0.058 0.048 0.025 0.030 0.027 0.01 0

165 0.721 0.025 0.229 0.682 0.01 0.611 0.276 0.005 0.595 0.569 TABLE 7.15 Alternative Backtest Results: Three Days Violation Ratio q Group 1 Group 2 Group 3 0.05 0.055 0.052 0.054 0.025 0.030 0

0.689 0.689 0.01 1.000 0.314 0.754 0.005 0.333 1.000 0.664 197 7.5 Backtesting TABLE 7.16 Alternative Backtest Results: Four Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 0.05 0.063 0.043 0.055 0

164 0.01 0.856 0.856 0.568 0.853 0.005 0.687 0.320 0.538 0.898 TABLE 7.17 Alternative Backtest Results: Five Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 0.05 0.050 0.063 0.057 0

173 1.000 1.000 0.689 1.000 0.005 0.538 0.582 0.582 1.000 1.000 TABLE 7.18 Alternative Backtest Results: Six Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 0.05 0.056 0.050 0

641 1.000 0.641 0.663 0.005 0.759 0.743 0.759 0.759 0.759 0.279 TABLE 7.19 Alternative Backtest Results: Seven Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 0.05 0.056 0

256 0.923 0.923 0.923 0.923 0.923 0.256 198 CHAPTER 7 Risk Forecasting with Multiple Timescales TABLE 7.20 Alternative Backtest Results: Eight Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 a NaN 0

0.449 0.928 (not a number) arises from log 0 in the likelihood ratio statistic when violation count is 0. TABLE 7.21 Alternative Backtest Results: Nine Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group 9 a

0.801 0.577 (not a number) arises from log 0 in the likelihood ratio statistic when violation count is 0. TABLE 7.22 Alternative Backtest Results: 10 Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group 9 Group

count is 0. 0.005 NaNa NaNa 0.280 0.697 NaNa 0.280 0.280 0.697 0.697 0.697 199 7.5 Backtesting use 20 or 21 days as the monthly horizon, as they are divisible by reasonable conversion factors.14 LRT results are presented in Tables 7

.23–7.2615 . Again, the high–low frequency model passes the backtests. 7.5.7 STABILITY OF THE LIKELIHOOD RATIO TEST AND ALGORITHM SPEED VaR estimates based on Monte Carlo simulation are inherently random. If we run

a specific backtest more than once, the number of VaR violations will not be a fixed number. Will such uncertainty affect the conclusion of LRTs? TABLE 7.

23 Backtest Results: 7–21 Days Violation Ratio q Group 1 Group 2 Group 3 0.05 0.054 0.051 0.045 0.025 0.021

0.627 0.575 0.386 0.01 0.725 0.188 0.725 0.005 0.126 0.804 0.126 TABLE 7.24 Backtest Results: 5–20 Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 0.05 0.060 0.052 0.044 0.054

0.695 0.01 0.110 0.677 0.677 0.677 0.005 0.389 0.389 0.769 0.389 TABLE 7.25 Backtest Results: 4–20 Days Violation Ratio q Group 1 Group 2 Group 3 Group 4 Group 5 0.05 0.045 0.045 0.051

883 0.883 0.005 0.045 0.130 0.323 0.679 0.004 0.679 0.323 To investigate this problem, we first backtest a daily VaR forecast using the fixed-frequency method. Since VaR is computed using numerical integration and root finding, the resulting violation numbers are constant

as a benchmark. We then replace the VaR forecast step with Monte Carlo simulation as used in the high–low frequency method, repeat the same backtest again and again, and examine the discrepancy between violation numbers and the benchmark. As shown in Tables 7.27–7.30, all 20 trials,

third as compared to 10K, in terms of average discrepancy and maximum discrepancy, there is not much difference. Still, to be cautious, we performed all backtests listed in tables prior to Table 7.6. A using 30K simulations. 19 We use a laptop with 2.8 GHz CPU and 2 GB

memory. The software used is MATLAB R2007b. 20 In backtest, the time spent on calibration can be significantly reduced. Since most data are overlapping, we can use the parameters from calibration results of the previous

period as the initial values and start from scratch only infrequently, say every 200 days, to avoid overestimation. 17 Kupiec 201 7.5 Backtesting TABLE 7.27 Stability of Violation Counts Monte Carlo simulations (MC) = 10K α 95% 97.50% 99% 99.50% Benchmark Trial 1 Trial 2 Trial

is not traditionally used for time horizons less than one day, but to illuminate the possibilities for high frequency applications, we show multiscale VaR forecast backtest results for 2- through 5-min horizons, based on the same intraday data, in Tables 7.31–7.33 . We see some rejections of

the backtest null hypothesis for GARCH(1,1), but GARCH(2,2) and GARCH(3,3) behave quite reasonably. Therefore, at least for this high frequency returns

E(Zt+n |Ft+n−1 )|Ft = E(σt+n |Ft ). = E σt+n 204 CHAPTER 7 Risk Forecasting with Multiple Timescales TABLE 7.31 Backtest Results (p-Values) Using GARCH(1,1) 2-min Horizon α Group 1 Group 2 3-min Horizon α Group 1 Group 2 Group 3

508 0.885 0.508 (not a number) arises from log 0 in the likelihood ratio statistic when violation count is 0. TABLE 7.32 Backtest Results (p-Values) Using GARCH(2,2) 2-min Horizon α Group 1 Group 2 3-min Horizon α Group 1 Group 2 Group 3

log 0 in the likelihood ratio statistic when violation count is 0. 7.6 Further Analysis: Long-Term GARCH and Comparisons 205 TABLE 7.33 Backtest Results (p-Values) Using GARCH(3,3) 2-min Horizon α Group 1 Group 2 3-min Horizon α Group 1 Group 2 Group 3

The resulting conditional VaR of n-day returns as an asymptotically linear function of the time horizon n is obviously unrealistic and therefore should fail backtests with real data for large enough n. Results for the general GARCH(p,q) are similar. By similar arguments, the iterative equation for the conditional

fall within the 95% confidence interval of daily-based forecast. So the difference between the two methods is statistically significant. • Both models have passed the backtest, so unsurprisingly they record approximately the same number of VaR violations. However, the timings of these violations are different. More than 85% of VaR95% violations

window size and, 40 Alpha parameter, 121–122 α-stable Lévy processes, 125 Alternating decision trees (ADTs), 49–51 structure of, 50 Alternative backtest, 196 Alternative backtest result tables, 196–199 Analysts’ earnings forecast, 62 Analytical/simulation results, new, xi ANOVA, 37 Anselmo, Peter C., xiii, 235 Antipersistent activity, 148 Approximation

Average estimator, 279 BAC data series, DFA and Hurst methods applied to, 155 Backtest, evaluating results of, 192 Backtest algorithm, 189 Backtest failure ratio, 192 Backtesting, 188–203 Backtest null hypothesis, 202 Backtest results, using GARCH, 204–205 Backtest result tables, 192–195, 199–200 Backtest variant, 195–196 Balanced capital structure, 59 Balanced scorecards (BSCs), 48, 52

–287 Daily returns, 4, 14 Daily returns scenario, 215–216 Daily return/volatility, 211–212 Daily sampled indices, analysis of, 132–141 Daily VaR forecast, backtesting, 199–200. See also Value at risk (VaR) Index Data for NIG and VG model estimation, 18 statistical behavior of, 345 Data analysis methods, 122

system, 64 Multinomial recombining tree algorithm, 221, 226 Multinomial tree approximation method, 97–115 Multiple timescale forecasts, 185–188 Multiscale method, 217 Multiscale VaR forecast backtest results, 202. See also Value at risk (VaR) Multiscale volume classification, 33–35 Multistock automated trading system, 66 Multivariate normal distribution, 170 Multivariate normal mean

Finding Alphas: A Quantitative Approach to Building Trading Strategies

by Igor Tulchinsky  · 30 Sep 2019  · 321pp

the International Quant Championship. Participants who enter our competitions seek to create high-quality alphas using our online portal, WebSim, which provides educational, research, and backtesting tools, including some of the same datasets that WorldQuant researchers use. More broadly, the VRC enables individuals to conduct research and seek to build high

research, key steps to developing an alpha, and the evaluation and improvement of quality alphas. The key technical aspects discussed in this section are turnover, backtesting, fundamental analysis, equity price volume, statistical arbitrage, overfitting, and alpha diversity. Part III explores ad hoc topics in alpha design, including alpha design for

, we introduce you to WebSim, a web-based alpha development tool. We invite all quant enthusiasts to utilize this free tool to learn about alpha backtesting (also known as alpha simulation) and ultimately to create their own alphas. Finally, in Part V, we present an inspirational essay for all quants

their nights, in search of alphas. The topics range widely, from the 6 Finding Alphas nuts-­and-­bolts development of alphas, to their extensive ­backtesting, and related subjects like momentum alphas, the use of futures in trading, institutional research in alpha development, and the impact of news and social media

also a chapter focused on various aspects of WorldQuant’s WebSim platform, our proprietary, internet-­enabled simulation platform. WebSim’s simulation software engine lets anyone backtest alphas, using a large and expanding array of datasets. Last, in this edition of Finding Alphas, we’ve added new material on topics such

To answer these questions, good quantitative measurements are required. A typical method for collecting measurements about trading strategies is to run a simulation (that is, backtest) and measure characteristics of the result, such as the information ratio. One way to make analogous measurements for an alpha is to do a mapping

signals in this manner, deciding which method and parameters to use will depend on the data and the alpha’s horizon. With careful experimentation and backtesting, we can choose an optimal point where the outliers and noise are reduced, the signal is smoothed, the turnover is lowered, and the performance

longer past period. An alpha based on a completely novel trading idea is generally unique and adds the most value to the alpha pool. 9 Backtest – Signal or Overfitting? By Zhuangxi Fang and Peng Yan INTRODUCTION Over the past decade, quite a few quant funds have gained tremendous success in

the Reuleaux triangle. Because different implementations often have different strengths and weaknesses, a good ensemble of implementations is generally more robust than any individual instance. BACKTESTING There are two basic ways of generating signals: through ideas or through data. In the idea-driven process, the seed of an alpha design idea

trials futile. Only a few of them have the potential to generate consistent profits in the real environment. In many cases, a researcher will have Backtest – Signal or Overfitting?71 a strong belief that a model will work but will find after testing that it does not – or, conversely, the

have a weak effect that is outweighed by other factors, or the initial idea may simply be wrong because markets often behave counterintuitively. Simulation and Backtesting There are many possible methods to test the validity of a hypothesis, including: •• A Monte Carlo simulation, which simulates the various sources of uncertainty

which calculate asset prices (for example, the Black– Scholes options pricing model). •• Explanatory models, which analyze what happened historically. In our working environment, simulation means backtesting: the process of applying a specific model to unbiased historical data under certain market assumptions and risk constraints to test its simulated historical performance. The

implicit assumption of backtesting is that if the idea worked in history, then it is more likely to work in the future. A model will generally not be

considered unless it has been validated in simulation. Backtesting results are used for preselecting models, comparing different models, and judging the potential value of such alphas. These results can be assessed using various

measures, such as returns, Sharpe ratio (return over risk), turnover (trading frequency), and correlation with other alphas. Good backtesting results are not sufficient for a profitable strategy, however; many other factors will affect investment performance. As a general matter, investors should not invest capital

based solely on backtesting simulation results. Some of the reasons are: •• The current market may not be the same as the historical period. Market rules are always changing,

quant world, overfitting, or the apparent discovery of a price-­driving rule that turns out to be incorrect, is an inherent risk in any backtesting framework. A spurious relationship may appear to be statistically significant in the historical data on which it was developed, then disappear in the future and

they may have a higher chance of winning again. The lesson is that purely playing with numbers may help you find some significant results, but Backtest – Signal or Overfitting?73 to create good alphas it is important to recognize the underlying price-­ driving principle and separate it from spurious noise.

to be careful to evaluate the overfitting risk of the models. Suppose that a researcher is looking to identify at least one two-­year-­ long backtesting period with an annualized Sharpe ratio higher than 1. If he tries enough strategy configurations, he will eventually find one even if the strategies

are actually random, with an expected out-­of-­sample Sharpe ratio of 0. By trying a large enough number of strategy configurations, a backtest can always be fitted to any desired performance for a fixed sample length. A signal can be defined as a strategy configuration whose last M

ratios: the information ratio equals the information coefficient times the square root of breadth (Grinold and Kahn 1999). In the real world, unfortunately, there are Backtest – Signal or Overfitting?75 often constraints on the total number of relevant tradable instruments or the subset of instruments covered by the dataset. Test the

model over a longer history: As Table 9.1 shows, lengthening the backtesting period decreases the probability of accidental overfitting. However, longer is not always better because data may not be available for a long enough period or

but a reasonable combination of real alphas covering different aspects of true price-driving rules is more likely to result in successful profit-generating portfolios. Backtesting is necessary to develop and validate signals, but it runs the risk of overfitting. There are many ways to control the risk of overfitting;

© 2020 Tulchinsky et al., WorldQuant Virtual Research Center. Published 2020 by John Wiley & Sons, Ltd. 78 Finding Alphas Look-Ahead Bias In a simulation or backtest, when a signal or investment strategy at a given point in time uses data from a future point that would not have been known or

can introduce look-­ ahead bias. In particular, they may tune some hyper-parameters on the entire data sample and then use those parameters in the backtest. Hyper-­ parameters should always be tuned using only backward-looking data. Similarly, in the area of sentiment analysis, researchers should take note of vendor

continuous stretch of time. Typically, this is toward the end of the time series. 2. Hold out several interleaved stretches of time within the entire backtesting window. For example, hold out periods every alternate week within that window. When using interleaving, we need to ensure that any seasonality or autocorrelations

drawdown can bankrupt an individual investor or lead to capital flight from a fund, so it is very important to control drawdowns. When investigating a backtest result, an alpha’s drawdowns should be measured in relation to its other features – for example, its annualized return and information ratio. The annual

be expected to react. Examples of such cases include news events such as extreme natural disasters (beyond what the alpha would have seen in its backtesting period, unless the alpha is a news- or sentiment-based alpha that can be expected to exploit the event), sudden changes in the correlation

data and trial functions. The quantity of the alphas found will generally grow more slowly, but the quality should be significantly higher. LONGER BACKTESTING PERIODS Increasing the backtesting period raises the available number of data points and increases the statistical significance of the result, but only under the assumption that the dynamics

expected, are much faster to run, while the later rounds, where the fine-tuning occurs, use more data points for greater robustness. Extending the backtest period to each consecutive round also adds a quasi out-of-sample test at every round, allowing us to measure the yield and gain confidence

one alpha to another. Therefore, the confidence of each manual alpha can be measured separately. For example, the quality can be inferred from the backtest performance or the parameter sensitivity test. By contrast, in an automated search each alpha does not have a predetermined explanation behind it, so the confidence

careful to note the time delays in the data used for alpha generation. Point-in-time financial data provides significantly more-realistic results (and worse backtesting results) because it removes the forward bias associated with statement refilings. More sophisticated statistical analyses, such as regressions and factor correlation analysis, may produce

trade at much finer timescales, the performance and returns of intraday alphas are generally much higher. The statistical significance of intraday alphas for even shorter backtesting periods is much higher for intraday alphas than for daily alphas. As a result, the out-of-sample performance of the alphas is very

similar to the performance in the backtesting period. When making daily alphas, the analyst tries to keep the alphas neutral to all possible overnight risks, like dollar delta exposure, sector exposure,

take an equal-sized short position on SPY, which will give us a long–short-balanced market-neutral (and dollarneutral) alpha. The alpha’s backtested performance for the 10 years from 2004 through 2013 is shown in Figure 29.3. Interestingly, the alpha performed best around the 2008 financial crisis

past several years, with more-novel ETFs entering the universe of tradable liquid products. These instruments may exist only in the later part of the backtested period and hence adversely affect the reliability of the simulated in-sample performance. This is not a unique issue for ETFs, but it is

knowledge and a desire to learn more about financial markets. WHERE ALPHA IDEAS COME FROM As a simulation platform, WebSim takes user input and performs backtesting to determine the overall quality of an idea. The challenge for many users is how to find ideas in the first place. Although there

datasets that tend to be updated quarterly or annually. ANALYZING RESULTS Once the parameters are established and the alpha expression is entered, WebSim performs a backtest of the idea using historical data. Typically, the simulator will use a fictitious $20 million book, redistributing the capital on a daily basis to

Financial Economics 17: 223–249. Bailey, D., Borwein, J., Lopez de Prado, M., and Zhu, Q. (2014a) “Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance.” Notices of the American Mathematical Society 61, no. 5: 458–471. Banz, R. (1981) “The Relationship Between Return and

15, no. 2: 265–286. JOURNAL ARTICLES (ELECTRONIC/ONLINE) Bailey, D., Borwein, J., Lopez de Prado, M., and Zhu, Q. (2014b) “The Probability of Backtest Overfitting.” https://papers.ssrn.com/sol3/ Papers.cfm?abstract_id=2326253 Beaudan, P. (2013) “Telling the Good from the Bad and the Ugly: How to

Evaluate Backtested Investment Strategies.” http://ssrn.com/ abstract=2346600 Bochkay, K., Chava, S., and Hales, J. (2016) “Hyperbole or Reality? Investor Response to Extreme Language in

/18/career-­­­matters-­­­prior-­­­industry-­­­experience-­­­improves­­­ odds-­­­of-­­­success-­­­for-­­­wall-­­­street-­­­analysts Lopez de Prado, M. (2013) “What to Look for in a Backtest.” https:// papers.ssrn.com/sol3/papers.cfm?abstract_id=2308682 Matloff, N. (2011) “Fast Lane to Python.” University of California, Davis. http://heather.cs.

academia, news effects 160 accrual anomaly 96 acquisitions 196–199 AdaBoost 125 adaptive market hypothesis (AMH) 97 ADV see average daily trading volume algorithms backtesting 69–76 creation 12–13 cutting losses 17–21 data sources 25–26 evaluation 20–21, 28–29 prediction frequency 27 thinking in 127–132

196–199 statistical 10–11, 69–70 arbitrage pricing theory (APT) 95, 157 AsymBoost 125 ATR see average true range automated searches 111–120 backtesting 116–117 batch statistics 117–118 depth 116 diversification 118–119 efficiency 111–113 input data 113–114 intermediate variables 115 manual preparation 119 noise

information 181–182, 192 momentum 165 novelty 161–162 298Index sentiment 160–161 social 165–166 mergers and acquisitions (M&A) 196–199 models backtesting 69–76 elegance 75 inaccuracy of 10–11 see also algorithms; design; evaluation; machine learning; optimization momentum alphas 155–158, 165, 235–237 momentum

26 relative prices 12–13, 26 relevance, of news 162 Renaissance Technologies 8 research 7–15 analyst reports 179–193 automated searches 111–120 backtesting 13–14 300Index behavioral economics 11–12 computer adoption 7–9 evaluation 13–14 exchange-traded funds 231–240 implementation 12–13 intraday data

of informed trading (VPIN) 215 302Index VPIN see volume-synchronized probability of informed trading weather effects 46 WebSim 253–261 analysis 258–260 backtesting 33–41 data types 255 example 260–261 settings 256–258 weekly goals 266–267 weighted moving averages 55 Winsorization 92–93 Yahoo finance 180

Risk Management in Trading

by Davis Edwards  · 10 Jul 2014

Parrish Iordanis Karagiannidis Contents Preface ix CHAPTER 1 Trading and Hedge Funds 1 CHAPTER 2 Financial Markets 33 CHAPTER 3 Financial Mathematics 61 CHAPTER 4 Backtesting and Trade Forensics 95 CHAPTER 5 Mark to Market 121 CHAPTER 6 Value-at-Risk 141 CHAPTER 7 Hedging 177 CHAPTER 8 Options, Greeks, and

professional traders. The final six chapters of the book describe decisions that are made by traders. Risk avoidance and acceptance are discussed in Chapter 4: Backtesting and Trade Forensics. Avoiding risk is a strategic decision that involves determining the markets where a trader has the biggest advantage relative to other traders

applied to almost any trading or investment group. This book focuses on six major activities that are part of managing trading businesses. 1. Backtesting and Trade Forensics. Backtesting is a disciplined approach to testing trading ideas before making bets with actual money. Trade forensics 1 2 RISK MANAGEMENT IN TRADING 2. 3

. These processes have developed over time, because hedge fund managers—for all the potential profits that might be possible—have very little margin for error. Backtesting and Trade Forensics Professional traders such as hedge funds and investment banks’ proprietary trading desks often follow a disciplined approach of testing investment strategies before

placing any money at risk. The typical approach is to start with historical tests in a process called backtesting. Once that is finished, the historical tests are followed up with live simulations called paper tradingg. Then, once real money is at risk, the strategy

normally distributed. C. It will get pulled back to a long‐term average value. D. It will always have a positive first derivative. CHAPTER 4 Backtesting and Trade Forensics T his chapter describes how hedge funds and other disciplined traders develop trading strategies. Trading is extremely competitive and the best way

to take a systematic, disciplined approach to investing. This involves testing ideas both before and after the transaction. Before a trade is made, traders use backtesting to test strategies against historical data before they make bets with actual money. After the trade, trading forensics are used to perform a post-mortem

the idea for a trading strategy has been developed, it can go through several phases of testing. The first test is typically a backtestt. A backtest examines the trade to see if a trade would have been successful in prior years. To a risk manager, this testing is important since it

produced. Stale Data. Prices and similar data represent information at a specific point in time. Data that is infrequent may have a substantial lag between Backtesting and Trade Forensics ■ 97 when it was valid data and when it is superseded. In that intervening period, the data might be stale—not representative

to performing small scale transactions. Some of the common phases associated with testing trading strategies are: ■ ■ ■ ■ Backtesting. Backtestingg is the process of testing a trading strategy or idea over prior time periods. Out-of-Sample Backtesting. Out-of-sample backtestingg splits the historical data into two portions—a portion that is used

to eliminate a large number of potentially bad investment ideas. Typically, only strategies that have a good backtest are considered for real life implementation. 98 RISK MANAGEMENT IN TRADING The largest weakness in the backtesting approach is that, given enough attempts to develop a strategy, eventually it is possible to find some

is called curve fitting g or over-fitting. g KEY CONCEPT: SIMULATION ACCURACY Past performance does not necessarily guarantee future returns! Looking good in a backtest does not imply that the strategy will actually be predictive of the future. While it’s reasonably safe to assume that a recently observed problem

might recur several times, the opposite is not true. Backtesting can easily fail to identify potential problems. In almost every set of historical financial data, some investment will have out-performed other investments. Given enough

computer optimizer could identify which values resulted in the most profitable trades. However, this does not indicate that the approach will work in the future. Backtesting and Trade Forensics 99 KEY CONCEPT: RISK AND RETURN Risky investments are likely to have periods where they are both more profitable and have greater

look at profitability, the top-performing investment in any given historical period might be an extremely risky investment that just happened to get lucky. Historical Backtesting Historical backtesting is the process of using financial data for prior periods to develop and examine potential trading strategies. Inherent in the

backtesting process is a bias to selecting high-risk investments. This is due to the fact that traders will keep testing ideas on the same set

ones where a high percentage of trades are profitable and the losses can be controlled. Out-of-Sample Testing A common way to improve the backtesting process is to conduct tests on a set of data that is different from the one used to originally develop the strategy. This will identify

the most obvious cases of curve fitting. 100 RISK MANAGEMENT IN TRADING KEY CONCEPT: DATA MINING AND OVER-FITTING Backtesting is commonly associated with data mining g and technical analysis. These are both types of investing associated with analyzing historical price movements to predict future

it would be executed once actual trading begins allows the strategy developer to identify implementation problems. For example, with historical testing, pricing data already exists. Backtesting and Trade Forensics 101 KEY CONCEPT: TRANSACTIONS COSTS AND TIMING Two items that are hard to model from historical data are the costs associated with

. In a simulation, it might appear that lightning fast trades made just after the news story release could make a quick profit. This might not Backtesting and Trade Forensics FIGURE 4.1 103 Bid/Ask Spread actually be possible. The only way to see if they are actually profitable is to

price (typically the price of a recent transaction), however that does not mean that it is possible to make a trade at that price. 105 Backtesting and Trade Forensics Accept less money for immediate sale. Bid Prices Prices at which traders are willing to buy FIGURE 4.3 Pay more money

and analyzed. This data will be used to describe the expected daily returns and risk of a strategy assuming that the initial assumptions were accurate. Backtesting and Trade Forensics 107 MODEL RISK With both historical and Monte Carlo analysis, there is a risk that either the methodology or assumptions used in

the Sharpe Ratio The average daily return minus an appropriately scaled risk free rate. For example: Excess Daily Return = daily return − risk free rate 109 Backtesting and Trade Forensics Most commonly, Sharpe Ratios are calculated based on daily returns and then annualized. This is done assuming that returns are normally distributed

.4 A B 1.75% 25.13% −1.43% C −0.24% 18.59% 21.34% 1.10 −1.22 −0.18 Option Strategy Payoffs Backtesting and Trade Forensics 111 KEY CONCEPT: RANDOMNESS AND RESULTS When returns are not clustered around a typical value, it takes much longer to estimate the

The first line of trading surveillance is to ensure that trading positions are completely and correctly entered into trading and risk systems. In addition 113 Backtesting and Trade Forensics Ensure accurate data Holistic view of risk Intraday monitoring FIGURE 4.5 Separation of duties Timely, accurate position entry Independent price Marks

Strategy evaluation Historical backtesting Concentration risk Monitor for changes in trader behavior Monitor for changes in market behavior Monitor for unusual trades Trade surveillance Trade Surveillance to accuracy, timeliness

of their responsibilities. As a result, systems that accurately capture trading positions help to protect both the firm and the traders working at the firm. Backtesting and Trade Forensics 115 KEY CONCEPT: REVIEWERS Trading issues need to be handled by someone with sufficient time, familiarity, authority, and accountability to get results

that were appropriate when a model was first created can become invalidated over time and need to be regularly re-examined. Forward testing. Similar to backtesting, forward testing is performed over a period when a strategy was actually being traded. This allows an ongoing side by side comparison of actual results

single asset or assets that share a similar characteristic has a risk of being less diversified in practice than it has been over some historical backtesting period. Risk management tends to describe risk under typical conditions very well, but is less accurate at predicting rare or unusual events that might impact

not be true on the day that traders want to transact—for example, during the early part of a market crash or similar unusual event. Backtesting and Trade Forensics ■ ■ 117 Trade Repository. Requiring traders (and counterparties) to report contract details to a registered trade repository allows computer systems to automatically verify

arbitrage and time value of money. D. The maximum expected drawdown of a trading strategy 2. What is the primary benefit of out-of-sample backtesting? A. It allows the strategy to be modeled with normally distributed returns. B. It decreases volatility of the strategy

. Backtesting and Trade Forensics 3. 4. 5. 6. 7. 119 C. It increases the expected returns of the strategy. D. It reduces the likelihood of over-

. In this kind of analysis, VAR thresholds (usually indicated by solid black lines) are compared to actual results (gray marks). (See Figure 6.9, VAR Backtest.) This data can be analyzed to see if the number of samples outside the VAR estimate matches the confidence level of the VAR calculation. For

WTI graphic, 5.58 percent of the days had losses greater than the VAR threshold for the day. Given the 2200 daily observations in the backtest, this indicates that losses are more common than the 5 percent of samples estimated by VAR. NYMEX WTI Crude Oil FIGURE 6.9 01 3

/ 6/ 28 /2 01 0 /2 9 /2 28 6/ 6/ 28 00 00 6/ 28 /2 /2 0 28 6/ /2 28 6/ VAR Backtest 8 07 6 00 00 /2 6/ 28 6/ 28 /2 00 5 4 20.00% 15.00% 10.00% 5.00% 0.00% −5

excess returns (the average return) divided by volatility (standard deviation of returns). 278 ANSWER KEY 2. What is the primary benefit of out‐of‐sample backtesting? A. It allows the strategy to be modeled with normally distributed returns. B. It decreases volatility of the strategy. C. It increases the expected returns

, 49–50 assets financial, 37 real, 35–36 at-close orders, 20 at-open orders, 20 avoidance, risk, 28–29, 267 B back office, 14 backtesting, 1–2, 10 historical, 99 basis, 42 basis points, 48 bid/ask spread, 103 Black 76, 209 Black Scholes formula, 207–212 bond prices, 46

hedging, 2, 11, 177–179 costs, 180 creating volatile earnings via, 187 using, 179–180 hedging calculations, 185 highest and best use, 130–131 historical backtesting, 99 holistic view of risk, 115–117 I illiquid market, 35, 124 implementing credit limits, 259–260 implied volatility, 160–161 Information Ratio, 109–110

Efficiently Inefficient: How Smart Money Invests and Market Prices Are Determined

by Lasse Heje Pedersen  · 12 Apr 2015  · 504pp  · 139,137 words

Active Investment 17 Chapter 1 Understanding Hedge Funds and Other Smart Money 19 Chapter 2 Evaluating Trading Strategies: Performance Measures 27 Chapter 3 Finding and Backtesting Strategies: Profiting in Efficiently Inefficient Markets 39 Chapter 4 Portfolio Construction and Risk Management 54 Chapter 5 Trading and Financing a Strategy: Market and Funding

David Kabiller for his thoughtful visions about how to build a business (and for trying to make me a businessman); Andrea Frazzini, the fastest quant backtester around, for his great collaboration; Toby Moskowitz for sharing both the experience of going from academia to AQR and, initially, an office—you’re a

wrong. How do you know if the truth is one or the other? You implement the trading strategy—in live trading or in a simulated backtest—and, if you make money, it’s (1) and, if you lose, it’s (2). In other words, the book’s premise is that

such as the failure of the investment bank Lehman Brothers in 2008. Quants also have the advantage of efficient portfolio construction and the ability to “backtest” strategies, meaning that one can simulate how well one would have done by following such a strategy in the past. Of course, past success does

has been using. Furthermore, these measures can be used to evaluate a strategy that a hedge fund is considering and has been simulating via a backtest, as discussed in the next chapter. 2.1. ALPHA AND BETA The most basic measure of trading performance is, of course, the return, Rt,

fund, performance attribution can be used to determine which investment strategies appear to be working and which traders tend to make successful investments. 2.9. BACKTESTS VS. TRACK RECORDS It is important to distinguish between performance measures that are gross versus net of transaction costs and gross versus net of fees

fee and a high performance fee), in which case they must report the track record using the most conservative fee schedule. Hedge funds also consider backtests of their strategies, that is, historical simulations of their performance under assumptions about how they would have behaved in the past. While investors are ultimately

interested in net returns, a hedge fund might internally investigate a trading idea by first looking at the gross return in a backtest. Indeed, the hedge fund may first try to determine whether a strategy has any merit and, for this, examine whether the gross returns appear

by Asness, Krail, and Liew (2001), who suggested the lagged beta methodology due to Scholes and Williams (1977) and Dimson (1979). CHAPTER 3 Finding and Backtesting Strategies Profiting in Efficiently Inefficient Markets No trading strategies are guaranteed to always make money, but there exist strategies that have made profits more often

how liquidity risk and information advantages can be decomposed further, as we discuss next. After understanding the sources of trading profits, we discuss how to backtest a new trading idea. Figure 3.1. The main sources of profit for hedge fund strategies. 3.1. PRICES REFLECT AN EFFICIENTLY INEFFICIENT LEVEL OF

edge in trading and financing illiquid securities or by trading against demand pressures. 3.3. HOW TO BACKTEST A TRADING STRATEGY Once you have a trading idea, backtesting it can be a powerful tool. To backtest a trading strategy means to simulate how it would have done historically. Of course, historical performance

Surely, yes. Knowing this, you would be unlikely to put the trade on, and not doing so could save you a lot of money. A backtest can teach you about the risk of a strategy, and it can give you ideas about how to improve it. Running a

Backtest: Trading Rules and Beyond To perform a backtest, you need the following components: • Universe. The universe of securities to be traded. • Signals. The data used as input, the source

on with a time lag, for example, using the closing price one or two days later. While these backtest components are rather abstract when we discuss them in general, the notion of backtesting comes to life through the specific examples that we discuss in the chapters on trading strategies. Many types

micro level. • Portfolio rebalance rule. This trading rule looks at the entire portfolio of securities and defines how it is rebalanced. This trading rule is backtested as follows. For each time period, ○ Determine the optimal portfolio of securities. ○ Make a (paper) trade to rebalance to this portfolio. As an example

using many securities, you could have many or few positions on at any time, so your risk varies over time. For all types of backtests and trading rules, we need to worry about biases and trading costs, as we discuss next. Data Mining and Biases

strategies and the competitive pressure adjusts prices and reduces profitability.3 Perhaps an even more important reason is that all backtests suffer from data mining biases. When I say that all backtests suffer from this problem, I mean that certain biases are unavoidable. For example, when you are analyzing a trading

will not work well in the future, when you are actually trading on it. Or you tried the backtest because you heard someone made money on this trade, but, in this case, the backtest is biased to look good (your friend already told you!), even if this is by pure chance.

These unavoidable biases mean that we should discount backtest returns and place more weight on realized returns. Furthermore, we should discount backtests more if they have more inputs and have been tweaked or optimized more. While unavoidable biases should simply affect

how we should regard backtests, there are many avoidable biases that experienced traders and researchers fight hard to eliminate. For one, it is important to have an unbiased universe

included. If you want to use the S&P 500 stocks, you should use stocks that were in the index at the time of your backtest, just as you would have done if you did the trade back then. It is also crucial that the trading signals and trading rules

or estimated, this naturally creates a bias. For instance, if expected returns have been estimated by running a regression from 1990 to 2010, and you backtest a strategy based on these parameters over the same time period, then the performance is biased to look unrealistically good. The parameters were estimated to

• Compute the expected trading costs for every security and add them up, and • Subtract the total expected trading cost from the portfolio return. Adjusting a backtest for transaction costs is more important the higher the turnover of the trading strategy. Furthermore, transaction costs change the way in which you should construct

important implications, as discussed in section 5.1. 3.4. ON THE EQUIVALENCE OF PORTFOLIOS AND REGRESSIONS While simulating a trading strategy with a careful backtest gets closest to reality, running regressions is another useful tool. Since a successful trading strategy is ultimately based on a signal that can predict returns

point out that timing strategies are more susceptible to biases than security selection strategies. Indeed, the time series regression corresponds to a “cheating” in-sample backtest, since the position size depends on the average forecasting variable over time , but this average was not known at the beginning of the time period

the signal was in the top, middle, or bottom third is also cheating, because this was also not known in advance. A more correct backtest is to ask at any time whether the signal was high, medium, or low relative to the signals that had been seen up until that

you actually executed your trade versus the price you hoped to trade at when you started (i.e., the price you might use in a backtest). If you simply buy at the ask price, TC is half the bid–ask spread, and if you move the price, TC captures this

which trading strategy to use, how frequently to trade, and so on. Furthermore, our estimate of expected transaction costs tells us how to adjust a backtest for transaction costs. Of course, transaction costs differ across securities. Small stocks with low trading volume tend to have larger transaction costs than large stocks

expertise (called “style drift”). 5.6. FUNDING A TRADING STRATEGY: DEFINITION OF LEVERAGE Two of the biggest differences between running a paper portfolio in a backtest and running a real portfolio in a big hedge fund are (1) real-world portfolios incur transaction costs and (2) real-world portfolios need to

often influence human judgment, perhaps those very biases that create the trading opportunities in the first place. Third, the quant’s trading principles can be backtested using historical data. Quants view data and scientific methods as central to investing: We are misguided when we exalt ourselves by insisting that the psychology

investing differ along several dimensions, including their intellectual foundation, their turnover, their capacity, how trades are determined, and the extent to which they can be backtested. Fundamental quantitative investing seeks to apply fundamental analysis—just like discretionary traders—but does so in a systematic way. Fundamental quant is therefore based on

, letting the market determine which ones are being hit. This trading structure means that fundamental quant investing can be simulated via a backtest with some reliability; stat arb backtests rely heavily on assumptions on execution times, transaction costs, and fill rates; while HFT strategies are often difficult to simulate reliably so

at many more stocks and many more factors than is easily done by discretionary stock pickers. Further, we apply the same investment principles across stocks, backtest our strategies, and follow our models with some discipline. LHP: Do you always follow the models? CSA: Discipline is important. We do not think

investor’s interpretation of the recent indicators from economic news releases (e.g., the employment situation). Market timing rules can be analyzed using regressions and backtests (as also discussed in chapter 3). To be specific, let us consider how one might time the equity market based on the dividend yield. To

www.econ.yale.edu/~shiller/data.htm. How could you trade on the insights that come out of this regression? Let us consider a simple backtest. Table 10.1 shows that when the dividend yield has been high, the annualized market return in the following month has been high on average

, 11.2%. During periods of low dividend yield, the subsequent market return has been lower. This can be viewed as a backtest of the strategy to invest only when the dividend yield is high (or low). Investing only at those times would have given much of the

+ 1 11.2% 4.2% Market volatility t + 1 21.6% 15.3% Out-of-Sample vs. In-Sample Both the regression and the backtest above suffer from a serious problem: They were not known at the beginning of the time period in 1926! To make a timing strategy, an

and (3) how does variation in the predictor translate into future predicted returns? Each of these steps is difficult to do in real time, and backtests are often subject to biases with respect to some or all of them. First, choosing the predictor is not easy, and

backtests often tend to look at variables that have worked in the past, a selection bias as they may not work in the future. Second,

low is based on limited historical evidence or guidance from judgment and economic theory. This is easy, however, in an in-sample (i.e., cheating) backtest, but in 1932 investors did not know that this dividend was at an all-time high compared to the next 80 years, and in 2000

of the predictor translates into predicted returns, e.g., the regression coefficient is estimated with significant error even with a hundred years of data. To backtest a timing strategy in a realistic way, one must consider the out-of-sample performance, that is, the return that could have been achieved with

who need it for a specific reason, then such demand pressure gives a trader confidence that the anomalous price presents an opportunity. Furthermore, systematic traders backtest trading on such price discrepancies in general to see if the trading signal has worked in the past. A butterfly trade is betting against such

), “Speculative Investor Behavior in a Stock Market with Heterogeneous Expectations,” The Quarterly Journal of Economics 92, 323–336. Harvey, Campbell R., and Yan Liu (2013), “Backtesting,” working paper, Duke University, Durham, NC. Harvey, Campbell R., Yan Liu, and Heqing Zhu (2013), “… and the Cross-Section of Expected Returns,” working paper,

timing). See also portfolio construction assets under management (AUM), 74–75 AT&T, 319 auditors, 26 BAB. See betting against beta (BAB) backfill bias, 23 backtests of strategies, 2, 38, 47–50; adjusting for trading costs, 50, 69; Asness on, 163; biases affecting, 48–50; in fixed-income arbitrage, 252;

and, 2–3; capacity of, 72, 73f; performance measures of, 27–38; predictive regressions of, 50–53; profit sources of, 39–46, 40f. See also backtests of strategies; investment styles; specific strategies hedge ratio (delta, Δ): in binomial option pricing model, 237; in convertible bond arbitrage, 275, 275f, 283; to make

sellers as providers of, 132; as source of profits, 39, 40–42, 40f information ratio (IR), 30, 31; adjusted for stale prices, 37 in-sample backtests, 50, 53 insider selling, 125, 128 insider trading, 9, 40–41, 294, 318 Integrated Resources, 129 interest rate futures, 190 interest-rate risk: in convertible

36, 239; leverage embedded in, 236, 240; markets for, 241; risk associated with, 236. See also derivatives order flow, trading on, 107 out-of-sample backtests, 50, 53 output gap, 189, 189n, 190 output of a country, 192–93, 193f overheated economy, 191, 191t; demand shocks and, 196 overreaction/underreaction, ix

12, 200 theta, 280, 280f Tiger Cub funds, 108 Tiger Management Corporation, 1, 108 time decay, in convertible bond arbitrage, 280, 280f time lags, in backtesting, 47 time series momentum strategies, 209–10; margin requirements for, 225; position sizing in, 213, 213n, 214, 219–20, 225; single-assets example (1985 to

defined, 47; implementation costs and, 64 trading signals, 47; multivariate regression on, 51, 53 trading strategies. See hedge fund strategies transaction costs, 63–64; adjusting backtests for, 50; of arbitrage trades, 235; Asness on, 160, 163; estimating expected values of, 69–70; implementation shortfall and, 70–72; liquidity of securities and

Traders at Work: How the World's Most Successful Traders Make Their Living in the Markets

by Tim Bourquin and Nicholas Mango  · 26 Dec 2012  · 327pp  · 91,351 words

-four or forty before it retraced. I have to bear in mind that I’m taking a signal for a one-minute chart, and having backtested so extensively, I’ve found the average movement of winning trades to be about thirty pips. Although you don’t always get thirty, you almost

or no human interaction required. While fully automated trading may be a dream for many traders, it was only through thousands of hours of meticulous backtesting and some costly, difficult lessons learned along the way that German made it a reality. By requiring that his strategy work in all markets and

solidified what I have been trying to do all these years, which is to have a strict set of rules to follow that can be backtested over any market. That’s really what brought trend following into the forefront of my trading. Bourquin: When we are talking about trend following, are

the direction of that breakout, and you fine-tune your stop based on your testing. Bourquin: Are you constantly backtesting markets to find where certain trends work best? Or have you backtested trades in the past so that you now know what approach works best in a given market and can apply

it going forward? German: Initially, trend following involves a lot of backtesting and thousands and thousands of tests, including millions of iterations on all kinds of different markets, with all kinds of different trend-following strategies and

approaches to stops and profit targets. There is an initial period where you are backtesting for ten hours a day, but then you get into a rhythm where you determine what works, based on your

backtesting. I did a great deal of backtesting over a couple of years, which solidified the markets that I wanted to trade, the program that I wanted to follow, and what does and

not work for me. Now, every time we experience a drawdown or every time I want to question or test myself, I will do some backtesting. But at the end of the day, I always go back to my original set of tests, and that is what I have been trading

do well for years. Do you think that’s the case with most ­backtested strategies? German: Whether or not a backtested strategy does well over the long term depends on the way in which that particular strategy was backtested. A backtested strategy might look great on paper but not make any money in real

life. That said, I will not trade anything that hasn’t been tested. Maybe I’m just wired this way now, because I have been backtesting strategies for so long, and it’s kind of engrained in me, but when somebody says they are doing this or that in the market

know it works? How can you trade that? How can you have any conviction when you are experiencing tough times?” Generally, somebody who hasn’t backtested their strategy would get discouraged and quit trading when they are in a drawdown. The same thing goes for buying a system. You can’t

spend $1,000 on a system and put any real amount of money or confidence into it. I always tell anybody who asks me about backtesting the same thing: you need to roll up your sleeves. You need to test everything in and out, up and down, and in all the

across all of the markets, then you have done some curve fitting, or it’s just not reliable. It’s not robust. In all the backtesting that I did across thirty-plus futures markets, there were a small handful—maybe a half-dozen—that my strategy didn’t work on in

your entry strategy require a lot of confidence? German: Yes. Sticking to the entire system requires tremendous confidence. But, again, you go back to your backtesting, and I have tested a close above, a close below, and a breach by x number of ranges or x distance. I have tested all

’s what I use to get out of a profitable trade. Bourquin: Can I ask what software you use in your trend following and your backtesting? German: I use a bunch of different software. I don’t want to go through all the different software that I use, but I can

say that there are several inexpensive options for doing basic backtesting. It gets tricky, however, when you start to think about the cleanliness of your data and how to fuse different contract months and rollover periods

for longer-term backtesting. That said, when I started, TradeStation was the easiest to learn. That’s really all you need to get started. Bourquin: Once you’re into

a lot of money? Did you make a lot of money right away? What was that experience like? German: It was an expensive lesson in backtesting. I was 110 percent all for trend following. Markets were moving big, I committed a decent amount of money to my trading account, and I

I lost a good chunk of capital following those rules. I was so sold on the theory of trend following that I did not even backtest my system. That is when I decided that nothing gets traded unless I have performed rigorous testing and decided it is viable. That was one

pretty good, and the trades looked clean. I require clean order flow and clean price action in any markets I trade, so I did some backtesting and subscribed to data feeds for bond futures after that. It’s not my favorite market, and I’m still getting comfortable with it, but

catch the resumption of that uptrend. Bourquin: How did you figure out that this setup worked? Toma: A lot of practice and a lot of backtesting. I’m a risk manager by trade, and while I consider myself to be a decent trader, I’m a really good risk ­manager. As

a result of that, I’m very data driven. I do a lot of backtesting, I sample with different types of bar and tick charts, and I measure the ones that have the optimal return, given my level of risk

. I backtest everything rigorously, and for a setup to get on my top-ten list, it has to produce results in all different kinds of markets and

I’m on the wrong side of the trade. If I’m stopped out, I’ll just move on to the next. After some thorough backtesting, I added a new setup that capitalizes on this retail panic, and it is actually now my number three performer and the fastest-growing profit

the trade setup presents itself. Even automated system traders will tell you that a run of losing trades that goes beyond the normal drawdown in backtests is normal. The key, of course, is knowing the difference between when your “edge” is no longer an “edge” and when you’ve simply had

moving averages technical indicators time frame trading options trend follower Williams %R G GAIN Capital Asset Management Gartman, Dennis German, Charles ATR automated trading system backtesting daily chart future market green trade independent trader market portfolio mentors money management moving average price action risk management rule-based approach scaling out screen

moving average (SMA) SimplerOptions.com Small Order Execution System (SOES) T TheStockBandit.com Toma, Michael algorithmic program trading amateur trader arbitrary stop average retail trader backtesting bond future bond trader bond volume charts data-driven analytics edge effective journaling EMA and WMA E-mini S&P futures (ES) contract trader trade

Learn Algorithmic Trading

by Sebastien Donadio  · 7 Nov 2019

The Rise of Carry: The Dangerous Consequences of Volatility Suppression and the New Financial Order of Decaying Growth and Recurring Crisis

by Tim Lee, Jamie Lee and Kevin Coldiron  · 13 Dec 2019  · 241pp  · 81,805 words

The New Trading for a Living: Psychology, Discipline, Trading Tools and Systems, Risk Control, Trade Management

by Alexander Elder  · 28 Sep 2014  · 464pp  · 117,495 words

Investing Amid Low Expected Returns: Making the Most When Markets Offer the Least

by Antti Ilmanen  · 24 Feb 2022

Systematic Trading: A Unique New Method for Designing Trading and Investing Systems

by Robert Carver  · 13 Sep 2015

Unknown Market Wizards: The Best Traders You've Never Heard Of

by Jack D. Schwager  · 2 Nov 2020

Expected Returns: An Investor's Guide to Harvesting Market Rewards

by Antti Ilmanen  · 4 Apr 2011  · 1,088pp  · 228,743 words

The Permanent Portfolio

by Craig Rowland and J. M. Lawson  · 27 Aug 2012

Mathematics of the Financial Markets: Financial Instruments and Derivatives Modelling, Valuation and Risk Issues

by Alain Ruttiens  · 24 Apr 2013  · 447pp  · 104,258 words

Market Risk Analysis, Quantitative Methods in Finance

by Carol Alexander  · 2 Jan 2007  · 320pp  · 33,385 words

Hedge Fund Market Wizards

by Jack D. Schwager  · 24 Apr 2012  · 272pp  · 19,172 words

How I Became a Quant: Insights From 25 of Wall Street's Elite

by Richard R. Lindsey and Barry Schachter  · 30 Jun 2007

Evidence-Based Technical Analysis: Applying the Scientific Method and Statistical Inference to Trading Signals

by David Aronson  · 1 Nov 2006

The Missing Billionaires: A Guide to Better Financial Decisions

by Victor Haghani and James White  · 27 Aug 2023  · 314pp  · 122,534 words

Fooled by Randomness: The Hidden Role of Chance in Life and in the Markets

by Nassim Nicholas Taleb  · 1 Jan 2001  · 111pp  · 1 words

The Intelligent Asset Allocator: How to Build Your Portfolio to Maximize Returns and Minimize Risk

by William J. Bernstein  · 12 Oct 2000

On the Edge: The Art of Risking Everything

by Nate Silver  · 12 Aug 2024  · 848pp  · 227,015 words

High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems

by Irene Aldridge  · 1 Dec 2009  · 354pp  · 26,550 words

The Little Book That Still Beats the Market

by Joel Greenblatt  · 2 Jan 2010  · 120pp  · 39,637 words

Predictive Analytics: The Power to Predict Who Will Click, Buy, Lie, or Die

by Eric Siegel  · 19 Feb 2013  · 502pp  · 107,657 words

Trend Following: How Great Traders Make Millions in Up or Down Markets

by Michael W. Covel  · 19 Mar 2007  · 467pp  · 154,960 words

Machine, Platform, Crowd: Harnessing Our Digital Future

by Andrew McAfee and Erik Brynjolfsson  · 26 Jun 2017  · 472pp  · 117,093 words

The Man Who Solved the Market: How Jim Simons Launched the Quant Revolution

by Gregory Zuckerman  · 5 Nov 2019  · 407pp  · 104,622 words

Trading Risk: Enhanced Profitability Through Risk Control

by Kenneth L. Grant  · 1 Sep 2004

Python for Data Analysis

by Wes McKinney  · 30 Dec 2011  · 752pp  · 131,533 words

Electronic and Algorithmic Trading Technology: The Complete Guide

by Kendall Kim  · 31 May 2007  · 224pp  · 13,238 words

Quantitative Value: A Practitioner's Guide to Automating Intelligent Investment and Eliminating Behavioral Errors

by Wesley R. Gray and Tobias E. Carlisle  · 29 Nov 2012  · 263pp  · 75,455 words

The New Sell and Sell Short: How to Take Profits, Cut Losses, and Benefit From Price Declines

by Alexander Elder  · 1 Jan 2008  · 394pp  · 85,252 words

Endless Money: The Moral Hazards of Socialism

by William Baker and Addison Wiggin  · 2 Nov 2009  · 444pp  · 151,136 words

Chaos Kings: How Wall Street Traders Make Billions in the New Age of Crisis

by Scott Patterson  · 5 Jun 2023  · 289pp  · 95,046 words

What's Your Future Worth?: Using Present Value to Make Better Decisions

by Peter Neuwirth  · 2 Mar 2015  · 161pp  · 51,919 words

The Behavioral Investor

by Daniel Crosby  · 15 Feb 2018  · 249pp  · 77,342 words

Adaptive Markets: Financial Evolution at the Speed of Thought

by Andrew W. Lo  · 3 Apr 2017  · 733pp  · 179,391 words

The Little Book of Common Sense Investing: The Only Way to Guarantee Your Fair Share of Stock Market Returns

by John C. Bogle  · 1 Jan 2007  · 356pp  · 51,419 words

Deep Value

by Tobias E. Carlisle  · 19 Aug 2014

The Big Secret for the Small Investor: A New Route to Long-Term Investment Success

by Joel Greenblatt  · 11 Apr 2011  · 89pp  · 29,198 words

Heads I Win, Tails I Win

by Spencer Jakab  · 21 Jun 2016  · 303pp  · 84,023 words

New Market Wizards: Conversations With America's Top Traders

by Jack D. Schwager  · 28 Jan 1994  · 512pp  · 162,977 words

Trade Your Way to Financial Freedom

by van K. Tharp  · 1 Jan 1998

Capital Ideas: The Improbable Origins of Modern Wall Street

by Peter L. Bernstein  · 19 Jun 2005  · 425pp  · 122,223 words

The New Science of Asset Allocation: Risk Management in a Multi-Asset World

by Thomas Schneeweis, Garry B. Crowder and Hossein Kazemi  · 8 Mar 2010  · 317pp  · 106,130 words

Security Analysis

by Benjamin Graham and David Dodd  · 1 Jan 1962  · 1,042pp  · 266,547 words

Market Wizards: Interviews With Top Traders

by Jack D. Schwager  · 7 Feb 2012  · 499pp  · 148,160 words