Blog Archives

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 »

Calling Systematic Investor Toolbox from Excel using RExcel & VBA

April 9, 2012
By
Calling Systematic Investor Toolbox from Excel using RExcel & VBA

RExcel is a great tool to connect R and Microsoft Excel. With a press of a button, I can easily execute my R scripts and present output interactively in Excel. This easy integration allows non-R users to explore the power R language. As an example of this approach, I want to show how to create

Read more »

Transaction Cost and Execution Price functionality in the Backtesting library in the Systematic Investor Toolbox

April 2, 2012
By
Transaction Cost and Execution Price functionality in the Backtesting library in the Systematic Investor Toolbox

I want to introduce the Transaction Cost and Execution Price functionality in the Backtesting library in the Systematic Investor Toolbox. The Transaction Cost is implemented by a commission parameter in the bt.run() function. You may specify the commissions in $ per share for “share” type backtest and as a percentage of total trade for “weight”

Read more »

Gini Efficient Frontier

March 23, 2012
By
Gini Efficient Frontier

David Varadi have recently wrote two posts about Gini Coefficient: I Dream of Gini, and Mean-Gini Optimization. I want to show how to use Gini risk measure to construct efficient frontier and compare it with alternative risk measures I discussed previously. I will use Gini mean difference risk measure – the mean of the difference

Read more »

Backtesting Asset Allocation portfolios

March 18, 2012
By
Backtesting Asset Allocation portfolios

In the last post, Portfolio Optimization: Specify constraints with GNU MathProg language, Paolo and MC raised a question: “How would you construct an equal risk contribution portfolio?” Unfortunately, this problem cannot be expressed as a Linear or Quadratic Programming problem. The outline for this post: I will show how Equal Risk Contribution portfolio can be

Read more »

Portfolio Optimization: Specify constraints with GNU MathProg language

March 14, 2012
By
Portfolio Optimization: Specify constraints with GNU MathProg language

I have previously described a few examples of portfolio construction: Introduction to Asset Allocation Maximum Loss and Mean-Absolute Deviation risk measures 130/30 Portfolio Construction Minimum Investment and Number of Assets Portfolio Cardinality Constraints Multiple Factor Model – Building 130/30 Index (Update) I created a number of helper functions to simplify process of making the constraints(

Read more »

Multiple Factor Model – Building 130/30 Index

March 5, 2012
By
Multiple Factor Model – Building 130/30 Index

Nico brought to my attention the 130/30: The New Long-Only (2008) by A. Lo, P. Patel paper in his comment to the Multiple Factor Model – Building CSFB Factors post. This paper presents a very detailed step by step guide to building 130/30 Index using average CSFB Factors as the alpha model and MSCI Barra

Read more »