This article is about a long/short equity strategy developed with DLPAL. The large sample and the exceptional performance during the 2008 bear market demonstrate the predictive power of the features generated by DLPAL for developing institutional grade strategies as well as their importance for hedge funds.
In a recent article we offered a brief introduction to long/short equity strategy development with DLPAL. Below is a quote from that article:
“Long/short equity strategies involve taking both long and short positions so that a net profit is made while market exposure is minimized. If the strategy is designed properly, then usually during bull markets long positions tend to be more profitable than short and the other way around during bear markets. Therefore, the profitability of a long/short strategy does not depend on market direction.”
DLPAL software offers a unique capability of calculating historical values of four indicators (also called features, attributes or predictors in machine learning) using the historical data for each stock in a universe of any size. The frequency of the data is usually daily but it can also be weekly. Long/short equity signals are then generated based on the values of the four indicators, PLong, PShort, Pdelta and S, or any combination of them. More details about these indicators can be found in the program manual.
The historical data files of the indicators can be imported in a backtesting platform for developing and testing long/short strategies. In this article we consider an example involving a universe of 23 Dow stocks and the history for the indicators starts in 01/2006. The choice of 23 Dow stocks was based on two criteria only:
(1) There is enough history available before 01/2006 to allow calculating the four indicators that are used in the strategy
(2) There are no stock splits after 01/2006 and this makes the analysis simpler especially when accounting for commission cost
Note that Criterion (2) is important since any price adjustments affect position size and transaction cost. Since with the example in this article we intend to demonstrate the concept, the original Dow-30 universe was reduced accordingly. In the case of stocks with splits, more detailed testing should be done on higher frequency data. Although retail traders are not so much concerned with these issues, they turn out to be important when developing strategies with a large sample size. Often, execution of long/short strategies derived from a large universe of stocks results in prohibitive cost for retail traders and this is one reason they often resort to the limiting case of pairs trading. However, as the number of open positions decreases, the risks of ruin increase due to larger variance of returns. Therefore, long/short equity strategies based on a large universe make sense when commission cost can be kept low and this is possible only at the institutional level of trading.
Historical file generation
The historical indicator files were generated by DLPAL LS, an institutional grade version of DLPAL software. However, the same files can be generated by DLPAL PRO.
The DLPAL software takes the original historical data files of the stocks and creates a new set of files with extension .pih that include the indicator values for each instance (row). An example is shown below for AXP.
The .pih files are then imported in a trading platform. Here we use Amibroker because it offers advanced portfolio backtesting and analysis capabilities in addition to the ease of importing historical data with additional fields. The four indicators are imported as follows: PLong is assigned to Volume, PShort is assigned to Open Interest, Pdelta is assigned to AUX1 and S to AUX2. A typical chart of the stock with the indicators is shown below.
Time-frame: Daily (adjusted data)
Strategy type: Long/short equity
Universe: 23 Dow stocks from current composition
Backtest period: 01/03/2006 – 03/17/2017
Maximum open positions: 22
Commission per share: $0.005
Position size per stock: Equity/22
Position entry and exit: Open of next bar
Although there are several options, including the use of machine learning classifiers in the case of more advanced models, here we use AUX1 and AUX2 indicators as follows.
Buy = Cover = AUX1 × AUX2 > 0
Short = Sell = AUX1 × AYX2 < 0
|Parameter||With comm||No comm||Buy and Hold|
It may be seen that there is significant reduction in CAGR from 9.14% without commissions to 6.35% after commissions. This is expected due to the large sample of trades. However, even after commissions, strategy Sharpe and MAR are significantly higher than those of buy and hold.
Below are the equity curve, underwater equity curve and monthly returns table. (Click on images to enlarge.)
A 41.9% return for 2008 demonstrates the importance of long/short equity strategies during times of stock market turmoil. Even if this theoretical figure is reduced by 50% to account for slippage and missed trades due to lack of short inventory, the equity performance is still significant given buy and hold drawdown.
Below is a Monte Carlo simulation graph.
The probability of a max drawdown greater than 17% is 1%, according to the simulation. This is pretty good.
The results in this article demonstrated at least two things:
(1) There is potential for significant edge in the indicators developed by DLPAL
(2) Long/short equity strategies have the potential of generating significant alpha during major stock market downtrends even if cost due to friction is high.
You can download a demo of DLPAL and DLPAL PRO here. For more articles about DLPAL and DLPAL PRO click here. Note that in the Basic and PRO version personal license there are certain limitations when creating historical indicator files.
We have also just announced DLPAL LS, a version of the program specifically designed for hedge funds. More details can be found here.
If you have any questions or comments, happy to connect on Twitter: @priceactionlab
Charts were created with Amibroker – advanced charting and technical analysis software. http://www.amibroker.com