Blog Archives

Factor Attribution 2

June 26, 2012
By
Factor Attribution 2

I want to continue with Factor Attribution theme that I presented in the Factor Attribution post. I have re-organized the code logic into the following 4 functions: factor.rolling.regression – Factor Attribution over given rolling window factor.rolling.regression.detail.plot – detail time-series plot and histogram for each factor factor.rolling.regression.style.plot – historical style plot for selected 2 factors factor.rolling.regression.bt.plot

Read more »

Factor Attribution

June 19, 2012
By
Factor Attribution

I came across a very descriptive visualization of the Factor Attribution that I will replicate today. There is the Three Factor Rolling Regression Viewer at the mas financial tools web site that performs rolling window Factor Analysis of the “three-factor model” of Fama and French. The factor returns are available from the Kenneth R French:

Read more »

Volatility Position Sizing 2

June 11, 2012
By
Volatility Position Sizing 2

I have discussed Volatility Position Sizing in the Volatility Position Sizing to improve Risk Adjusted Performance post using the Average True Range (ATR) as a measure of Volatility. Today I want show how to use historical volatility to adjust portfolio leverage. Let’s start with Buy and Hold strategy using SPY and rescale it to the

Read more »

Volatility Quantiles

June 4, 2012
By
Volatility Quantiles

Today I want to examine the performance of stocks in the S&P 500 grouped into Quantiles based on one year historical Volatility. The idea is very simple: each week we will form Volatility Quantiles portfolios by grouping stocks in the S&P 500 into Quantiles using one year historical Volatility. Next we will backtest each portfolio

Read more »

Backtesting Classical Technical Patterns

May 28, 2012
By
Backtesting Classical Technical Patterns

In the last post, Classical Technical Patterns, I discussed the algorithm and pattern definitions presented in the Foundations of Technical Analysis by A. Lo, H. Mamaysky, J. Wang (2000) paper. Today, I want to check how different patterns performed historically using SPY. I will follow the rolling window procedure discussed on pages 14-15 of the

Read more »

Classical Technical Patterns

May 21, 2012
By
Classical Technical Patterns

In my presentation about Seasonality Analysis and Pattern Matching at the R/Finance conference, I used examples that I have previously covered in my blog: Month of the Year Seasonality – I introduced the Seasonality charts in the Historical Seasonality Analysis: What company in DOW 30 is likely to do well in January? post. I also

Read more »

Cross Sectional Correlation

May 7, 2012
By
Cross Sectional Correlation

Diversification is hard to find nowadays because financial markets are becoming increasingly correlated. I found a good visually presentation of Cross Sectional Correlation of stocks in the S&P 500 index in the Trading correlation by D. Varadi and C. Rittenhouse article. Let’s compute and plot the average correlation among stocks in the S&P 500 index

Read more »

Volatility Position Sizing to improve Risk Adjusted Performance

April 30, 2012
By
Volatility Position Sizing to improve Risk Adjusted Performance

Today I want to show how to use Volatility Position Sizing to improve strategy’s Risk Adjusted Performance. I will use the Average True Range (ATR) as a measure of Volatility and will increase allocation during low Volatility periods and will decrease allocation during high Volatility periods. Following are two good references that explain these strategy

Read more »

Intraday Backtest

April 22, 2012
By
Intraday Backtest

I came across a free source of Intraday Forex data while reading Forex Trading with R : Part 1 post. You can download either Daily or Hourly historical Forex data from the FXHISTORICALDATA.COM. The outline of this post: Download and Import Forex data Reference and Plot Intraday data Daily Backtest Intraday Backtest First,I created a

Read more »

Borrowing Ideas from Timely Portfolio

April 15, 2012
By
Borrowing Ideas from Timely Portfolio

I want to highlight two great Visualization techniques I discovered by reading the fine blog from Timely Portfolio. First method is based on the lm System on Nikkei with New Chart. Let’s visualize Strategy’s Long/Short/Not Invested periods by highlighting the underlying (i.e. buy & hold) with green/red/gray. Following is a sample code that implements this

Read more »