You are on page 1of 6

Financial Time Series Strategy Returns and P&L

Quantitative trading strategy evolution starts with forming trading ideas/hypothesis, acquiring raw data, constructing a hypothetical strategy, computing returns and P&L, analyzing the data, and finally drawing conclusions (or creating more hypotheses). This paper discusses the preparation process of the strategys returns and Profit and loss profile; it discusses the steps, issues and assumptions made during the preparation of the data sample: strategys returns and P&L. Finally, we discuss the risk limits established in common trading environments, and introduce methods to fit the strategy within those limits.

Raw Data
You have a trading idea, and you are anxious to see if it works, so whats next? Obviously, the first step is to acquire the raw data for the target market, but there are many public and commercial data vendors, so which one you chose? The decision where you acquire your data from depends on your market, asset class, sampling frequency, cost and the desired quality of the data. Many vendors perform a series of pre-processing steps (scrubbing) to detect and cleanup any distortion (e.g. duplicate points, missing points, invalid levels, etc.). In any case, we must always examine the data either visually (e.g. plot a graph) and/or systematically (using specialized validation scripts) before we use them for any further analysis. For this paper, we chose yahoo finance as our data source, and downloaded the daily prices for S&P 500 between Jan 1st, 2000 to May 9 th, 2009 (2351 trading days/points).

S&P 500
1600 1500 1400 1300 1200 1100 1000 900 800 700 600
Jan-00 Jul-00 Jan-01 Jul-01 Jan-02 Jul-02 Jan-03 Jul-03 Jan-04 Jul-04 Jan-05 Jul-05 Jan-06 Jul-06 Jan-07 Jul-07 Jan-08 Jul-08 Jan-09

Data Returns
Market participants quote the tradable asset by its price ($/unit) and our raw data set captures those prices (OPEN-HI-LO-CLOSE), so doesnt it make sense to analyze the price time series? Unfortunately, this is not the case. The econometric and time series analysis techniques assume that underlying series possess a time invariant mean and

Tel: (312) 324-0367

variance (i.e. weakly-stationary), but prices time series often exhibit time trends and, thus, is not deemed as a weakly-stationary process. For this reason, we convert the price series into returns which fortunately possess the statistical attributes mentioned above. Next, lets define how we can generate those returns the trading strategy returns. A trading strategy must have the following: 1. Enter Strategy 2. Exit Strategy 3. Holding Period When we should exit the strategy in case (2) did not trigger. Example Daily returns: A trader might examine the returns for buying a security at the market open and sells it just before market close. Stclose rt = ln( open ) = ln( Stclose ) ln( Stopen ) St Where: Stclose : The underlying security price at market close
Stopen : The underlying security price at market open
15% 10% 5% 0% -5% -10% -15%
Jan-00 May-00 Sep-00 Jan-01 May-01 Sep-01 Jan-02 May-02 Sep-02 Jan-03 May-03 Sep-03 Jan-04 May-04 Sep-04 Jan-05 May-05 Sep-05 Jan-06 May-06 Sep-06 Jan-07 May-07 Sep-07 Jan-08 May-08

%RET
%Ret WMA EWV

8% 7% 6% 5% 4% 3% 2% 1%

%VOL
Sep-08 Jan-09 May-09

0%

%Returns Descriptive Statistics Value Mean -0.01% Standard Deviation 1.38% Skewness -0.12 Excess-Kurtosis 7.10

TSAVG,TSSD, TSSKEW and TSXKurt functions compute the different descriptive statistics.

Can we realize those returns? Yes; a trader places two orders with his broker: market on open (MOO) buy order, and market on close (MOC) sell order.

www.spiderxl.com

Spider Financial Corp -2-

Tel: (312) 324-0367

Note: In academics papers, the daily returns are often computed as the returns of two closing prices: Stclose rt = ln( close ) = ln(Stclose ) ln( Stclose 1 ) St 1 Where Stclose 1 : The underlying security price at market-close for the previous trading day. Why we dont follow this method. The closing price of the day before and open price are correlated, but they are not the same. Trading sessions typically have different characteristics, e.g. market participants, volume/liquidity, etc.). Using close/close pair, we are joining the multiple trading sessions together in our analysis while we may only participate in one session, and not the other. For holding periods other than daily returns, the subtle difference between the two approaches (i.e. close/open vs. close/close) is less pronounced, but nevertheless, open/close is easy to trace and execute1 on. Example weekly returns: As in the case of daily returns, we construct a strategy to compute the returns for weekly holding period as follow: 1. Lookup the trading days for the listing market exchange. 2. For a given trading week, find the first and last trading day. 3. Using the open price for the first trading day and closing price on the last trading day, compute the weekly returns. Stclose rt = ln( open ) = ln( Stclose ) ln( Stopen ) St We can apply the same method for different holding period (e.g. bi-weekly, monthly, etc.)

Profit & Loss (P&L) Profile


Practitioners pay close attention to their strategys P&L profile throughout the holding period to ensure its compliance with their trading environment risk-limits. How can we describe the strategys P&L profile? Assuming we have the strategys portfolio value at Open/Close/HI/LO of the folding period, we can compute the P&L at close, and determine the maximum and minimum value during any given holding period. For our analysis, we considered one security for our strategy which we fully invested the $20,000 trading capital each day.

With daily holding periods, we avoid the need to calculate the roll or adjust returns for expiring derivatives contracts www.spiderxl.com

Spider Financial Corp -3-

Tel: (312) 324-0367

P & Lclose = N ( Stclose Stopen ) t P & Lmax = N ( StHI Stopen ) t P & Lmin = N ( StLO Stopen ) t N=
Where

20, 000 Stopen

N : Number of shares StHI : The underlying security highest price in the holding period
StLO : The underlying security highest price in the holding period

To alter the strategys P&L profile, we can either reduce the allocated trading capital (e.g. 20K) or implement a stop-loss mechanism to close the position at pre-set threshold2.
Descriptive Statistics (P&L - close) Mean $ (0.96) Standard Deviation $ 275.68 Minimum $ (1,745) Maximum $ 2,158 Median $ 8.34 Q1 $ (129) Q3 $ 125 Skewness Excess-Kurtosis 0.07 7.20
Descriptive Statistics (P&L - HI) Mean $ 151.20 Standard Deviation $ 179.94 Minimum $ Maximum $ 2,158 Median $ 104.08 Q1 $ 37 Q3 $ 199 Skewness Excess-Kurtosis 3.26 19.45 Descriptive Statistics (P&L - LO) Mean $ (163.82) Standard Deviation $ 197.09 Minimum $ (1,822) Maximum $ Median $ 104.08 Q1 $ (225) Q3 $ (32) Skewness Excess-Kurtosis -2.80 12.82

Please note that excess kurtosis for the P&L at market close differs from the one we computed earlier for daily log returns

In the table above, we observe the following: The realized P&L at market close varies between a loss of 1,745 (-8.7%) to a gain of 2,158 (10.8%). Throughout the day, the unrealized P&L can drops as low as $1,822 (9.2%), or climb as high as $2,158 (10.8%). In a typical trading environment, the unrealized P&L (i.e. P&L draw) is monitored for risk-management purposes, and, trader may be forced to close his/her position prematurely.. Prior to close, the trader sees his/her unrealized P&L climb to a healthy 10.8% at the market peak for that day. Timing market peak is not a trivial matter, and many traders employ some sort of technical analysis to spot this moment and close out the position. For our analysis, we will not approach the subject of market timing algorithms.
2

see our stop-loss white-paper for more details

www.spiderxl.com

Spider Financial Corp -4-

Tel: (312) 324-0367

Other Considerations
In our earlier discussion, we ignored the cost of transactions and we assumed we invested all our capital in the strategy, which implies we can buy/sell fractional shares. 1. Transaction cost The transaction cost refers to brokerage fees to work the buy/sell order on our behalf. The fee structure varies significantly across brokers, traded asset, order type (market versus limit order), order size, and any special agreement your firm has with their primary broker. Fortunately, the transaction fees are relatively small for low-frequency strategies (e.g. daily, weekly, etc.), and we can assume a flat fee per share traded. 2. Non-fractional shares Aside from mutual fund accounts, a trader can only buy whole number of shares. Why do we care? In our analysis, we need to round down the number of shares when we compute the P&L and computed weighted returns. The effect of nonfractional shares diminishes as the capital at risk grows in size. 3. Leverage In the outlined strategy, we have not considered borrowing money from our broker (i.e. buying on margin). Buying any portion of the position on margin introduces a new dimension to the risk limits/constraints. including margin levels (initial and maintenance levels), and also introduce interest expense for the borrowed money. Well discuss leverage or buying on margin in a separate white-paper for greater details. 4. Futures and Options Although, we chose the S&P 500 index, it is not an actual security, we can still implement the strategy using the SPDR - exchange-traded Fund (ETF) and ignore any tracking error between ETF and the index. Exchange-listed futures are slightly different beasts, and well discuss futures as an asset in a separate whitepaper for more in-depth analysis.

Multiple Strategies
A trading firm may be running several strategies concurrently; it divides the trading capital and allocates portions of the risk-limits among those strategies in an effort to maximize their returns (and reduce downside). Optimizing the risk-return characteristics of a portfolio (i.e. strategies) is beyond the scope of this white paper. To fully-address it, we need to examine the strategies returns inter-dependencies (e.g. correlation) over time. This topic will be addressed in depth as part of our multivariate time series analysis in future white-papers.

Conclusion
Prior to any analysis, we should examine thoroughly the subject data set; examine its points validity (visually and using tools) and perform any needed scrubbing. Next, we construct a strategy by determining the holding period and when we buy/sell the
www.spiderxl.com

Spider Financial Corp -5-

Tel: (312) 324-0367

underlying security. Finally, we compute the P&L at close, minimum and maximum value within holding period and compare it with our risk limits. A startegy must not only generate significant returns, but also operable with a specified trading environment. Practitioners often resort to either reduction in the capital at risk and/or setting a stoploss. Our proposed strategy using S&P 500 daily returns generates 0% daily returns, 1.38% volatility and a our portfolio value can gain or lose as much as 10% of its value. This is not a great strategy, so well try to improve it in following white papers.

References
1. Hull, J. C., Options, Futures & Other Derivatives, Prentice Hall, 2003 2. Pardo, R., The Evaluation and Optimization of Trading Strategies, Wiley, 2008. 3. The Chicago Board of Trade Handbook Of futures and Options, McGraw Hill, 2006 4. Campbell, J. Y., The Econometrics of Financial Markets, Princeton University Press, 1996. 5. Harris, L., Trading and Exchanges: Market Microstructure for Practitioners, Oxford University Press, 2002.

www.spiderxl.com

Spider Financial Corp -6-

You might also like