Quant finance code. Having more to say, please consider to be our guest blogger.

Dec
7

Pawel wrote a great article on predicting heavy and extreme losses in real-time for portfolio holders, the goal is to calculate the probability of a very rare event (e.g. a heavy and/or extreme loss) in the trading market (e.g. of a stock plummeting 5% or much more) in a specified time-horizon (e.g. on the next day, in one week, in one month, etc.). The probability. Not the certainty of that event.

Read this excellent post and accompanying Pathon codes at http://www.quantatrisk.com/2015/06/14/predicting-heavy-extreme-losses-portfolio-1/

In this Part 1, first, we look at the tail of an asset return distribution and compress our knowledge on Value-at-Risk (VaR) to extract the essence required to understand why VaR-stuff is not the best card in our deck. Next, we move to a classical Bayes’ theorem which helps us to derive a conditional probability of a rare event given… yep, another event that (hypothetically) will take place. Eventually, in Part 2, we will hit the bull between its eyes with an advanced concept taken from the Bayesian approach to statistics and map, in real-time, for any return-series its loss probabilities. Again, the probabilities, not certainties.

Read this excellent post and accompanying Pathon codes at http://www.quantatrisk.com/2015/06/14/predicting-heavy-extreme-losses-portfolio-1/

Mar
10

Han, Y.F., and Zhou, G.F. have an interesting working paper on the performance of a trend factor they proposed:

The basic idea is to first calculate the month-end price moving average time series of different lags, then regress cross-sectionally monthly returns at date t on all moving average series at date t-1, finally predict monthly returns at date t+1 using the regression estimates and the moving average series at date t. This procedure guarantees we forecast stock returns at t+1 with information set only up to t. We then rank all stocks based on the forecasts into five quintiles, long the quintile with highest forecast returns and short the quintile with lowest, and rebalance once per month. This strategy generates, on average, 1.61% monthly return and 0.29 sharpe ratio using all US stocks, performs especially good during recession, and outperforms several existing factors. Moreover, the good performance of this strategy cannot be explained by firm fundamentals.

I implement this strategy with Chinese stock data, adjust the rebalance frequency to weekly for convenience, and trade in extreme by always long the one stock with the highest forecast return, no short is allowed, stop loss is set at 5%. The result is amazing, it yields an annualized return at 97.15% from March, 2013 to Feb, 2014, with maximum drawdown at 30.01%. The fund curve is as follows (note: I didn't use all Chinese stocks but only 840 stocks in my stock pool with good liquidity, so there is selection bias and please accept the result cautiously...)

Nice shot. It seems to be better than the simple strategy between A-shares and H-shares.

In this paper, we propose a trend factor to capture cross-section stock price trends. In contrast to the popular momentum factor constructed by sorting stocks based on a single criterion of past year performance, we form our trend factor with a cross-section regression approach that makes use of multiple trend indicators containing daily, weekly, monthly and yearly information. We find that the average return on the trend factor is 1.61% per month, more than twice of the momentum factor. The Sharpe ratio is more than twice too. Moreover, during the recent financial crisis, the trend factor earns 1.65% per month while the momentum factor loses 1.33% per month. The trend factor return is robust to a variety of control variables including size, prior month return, book-to-market, idiosyncratic volatility, liquidity, etc., and is greater under greater information uncertainty. In addition, the trend factor explains well the cross-section decile portfolio returns sorted by short-term reversal, momentum, and long-term reversal as well as various price ratios (e.g. E/P), and performs much better than the momentum factor.

The basic idea is to first calculate the month-end price moving average time series of different lags, then regress cross-sectionally monthly returns at date t on all moving average series at date t-1, finally predict monthly returns at date t+1 using the regression estimates and the moving average series at date t. This procedure guarantees we forecast stock returns at t+1 with information set only up to t. We then rank all stocks based on the forecasts into five quintiles, long the quintile with highest forecast returns and short the quintile with lowest, and rebalance once per month. This strategy generates, on average, 1.61% monthly return and 0.29 sharpe ratio using all US stocks, performs especially good during recession, and outperforms several existing factors. Moreover, the good performance of this strategy cannot be explained by firm fundamentals.

I implement this strategy with Chinese stock data, adjust the rebalance frequency to weekly for convenience, and trade in extreme by always long the one stock with the highest forecast return, no short is allowed, stop loss is set at 5%. The result is amazing, it yields an annualized return at 97.15% from March, 2013 to Feb, 2014, with maximum drawdown at 30.01%. The fund curve is as follows (note: I didn't use all Chinese stocks but only 840 stocks in my stock pool with good liquidity, so there is selection bias and please accept the result cautiously...)

Nice shot. It seems to be better than the simple strategy between A-shares and H-shares.

Feb
3

*A similar article was posted at the sub-personal blog before and I paste it here in case someone is interested.*

At the moment there are 84 firms listed at both A (Shanghai and Shenzhen) and H (Hongkong) stock markets, according to the law of one price, the stock prices of these firms should be at similar level. However, there are huge differences, without considering exchange rate (1 RMB = 1.28 HK$), the ratio of the price in A market to the price in H market for a same firm is as low as 52.72% and as high as 617.59% as of 02/03/2014. Is the difference mean reverting? If yes, we would expect the stock traded cheaper in A market to go up, and vice versa. So can we make profit by long the stocks with large differences?

Rigorous statistical method should be undertaken to examine whether the ratio is indeed mean reverting. For simplicity, I construct a trading strategy that each week, I go long at the opening price the stock in A market that has the smallest price ratio of previous week, hold it one week and sell it at the weekly closing price. Short trading is not allowed for individual investor in A market. Stop loss is set arbitrarily at 5%. Transaction cost is 0.18% per trading.

The results for this simple strategy from 02.2013 to 01.2014 are:

Annualized Return 0.2070

Annualized Std Dev 0.2545

Annualized Sharpe 0.8133

Maximum Drawdown

From Trough To Depth Length To Trough Recovery

1 2013-09-13 2013-12-13 -0.1275 19 12 NA

2 2013-08-16 2013-08-23 2013-09-06 -0.0566 4 2 2

3 2013-03-22 2013-04-19 2013-05-03 -0.0488 5 3 2

4 2013-07-12 2013-07-12 2013-07-19 -0.0374 2 1 1

5 2013-05-31 2013-05-31 2013-07-05 -0.0229 6 1 5

The fund curve

Lower line is the return for a buy-and-hold strategy of all 84 firms.

Considering the fact that 2013 is a gloomy year for A market and this strategy is long only, the performance is not bad at all. Comments are welcomed

May
10

Stock returns however exhibit nonormal skewness and kurtosis as pointed out by Hull (1993) and Nattenburg (1994). Moreover, the volatility skews are a consequence of the empirical normality assumption violation. For this reason, Corrado and Su (1996) extend the Black-Scholes formula to account for nonnormal skewness and kurtosis in stock returns.

This package calculates the European put and call option prices using the Corrado and Su (1996) model. This method explicitly allows for excess skewness and kurtosis in an expanded Black-Scholes option pricing formula. The approach adapts a Gram-Charlier series expansions of the standard normal density function to yield an option price formula that is the sum of a Black–Scholes option price plus adjustment terms for nonnormal skewness and kurtosis (Corrado and Su, 1997).

For skewness = 0 and kurtosis = 3, the Corrado-Su option prices are equal to the prices obtained using the Black and Scholes (1973) model.

You can download the Matlab code at Corrado and Su (1996) European Option Prices.

References:

Corrado, C.J., and Su T. Skewness and kurtosis in S&P 500 Index returns implied by option prices. Financial Research 19:175–92, 1996.

Corrado, C.J., and Su T. Implied volatility skews and stock return skewness and kurtosis implied by stock option prices. European Journal of Finance 3:73–85, 1997.

Hull, J.C., "Options, Futures, and Other Derivatives", Prentice Hall, 5th edition, 2003.

Luenberger, D.G., "Investment Science", Oxford Press, 1998.

This package calculates the European put and call option prices using the Corrado and Su (1996) model. This method explicitly allows for excess skewness and kurtosis in an expanded Black-Scholes option pricing formula. The approach adapts a Gram-Charlier series expansions of the standard normal density function to yield an option price formula that is the sum of a Black–Scholes option price plus adjustment terms for nonnormal skewness and kurtosis (Corrado and Su, 1997).

For skewness = 0 and kurtosis = 3, the Corrado-Su option prices are equal to the prices obtained using the Black and Scholes (1973) model.

You can download the Matlab code at Corrado and Su (1996) European Option Prices.

References:

Corrado, C.J., and Su T. Skewness and kurtosis in S&P 500 Index returns implied by option prices. Financial Research 19:175–92, 1996.

Corrado, C.J., and Su T. Implied volatility skews and stock return skewness and kurtosis implied by stock option prices. European Journal of Finance 3:73–85, 1997.

Hull, J.C., "Options, Futures, and Other Derivatives", Prentice Hall, 5th edition, 2003.

Luenberger, D.G., "Investment Science", Oxford Press, 1998.

Dec
28

The Basel Committee on Banking Supervision has received a number of interpretation questions related to the December 2010 publication of the Basel III regulatory frameworks for capital and liquidity and the 13 January 2011 press release on the loss absorbency of capital at the point of non-viability.

Below are three sets of frequently asked questions (FAQs) that relate to counterparty credit risk, including the default counterparty credit risk charge, the credit valuation adjustment (CVA) capital charge and asset value correlations. More sets may be forthcoming, stay tuned.

First set

Second set

Third set

Fourth set

Below are three sets of frequently asked questions (FAQs) that relate to counterparty credit risk, including the default counterparty credit risk charge, the credit valuation adjustment (CVA) capital charge and asset value correlations. More sets may be forthcoming, stay tuned.

First set

Second set

Third set

Fourth set