Examples

Introduction to PortfolioAnalytics

PortfolioAnalytics Basics body, td { font-family: sans-serif; background-color: white; font-size: 12px; margin: 8px; } tt, code, pre { font-family: ‘DejaVu Sans Mono’, ‘Droid Sans Mono’, ‘Lucida Console’, Consolas, Monaco, monospace; } h1 { font-size:2.2em; } h2 { font-size:1.8em; } h3 { font-size:1.4em; } h4 { font-size:1.0em; } h5 { font-size:0.9em; } h6 { font-size:0.8em; } a:visited { color: rgb(50%, 0%, 50%); } pre { margin-top: 0; max-width: 95%; border: 1px solid #ccc; white-space: pre-wrap; } pre code { display: block; padding: 0.

Tactical asset allocation using quantstrat

I am trying to run this script in R-Studio on OSX … Lemao - Aug 2, 2011I am trying to run this script in R-Studio on OSX but I am getting the following error: > currency(“USD”) Error in assign(primary_id, currency_temp, envir = as.environment(.instrument)) : object ‘.instrument’ not found I have installed the dependencies: zoo, xts, TTR, RTAQ, quantstrat, quantmod, Performanceanalytics, FInancialInstrument, Defaults and blotter. Any ideas of what is going wrong here?

Tactical asset allocation using quantstrat

As promised in the introduction to quantstrat, here is an example strategy. I thought I’d start with the obligatory tactial asset allocation (TAA) strategy. This post will replicate the strategy in the post, tactical asset allocation using blotter. The “faber” demo in the quanstrat package contains a TAA strategy but it uses a slightly different approach than the code we’re trying to replicate. There are two major differences: The blotter TAA code initiates a position at the first observation where the close is above the SMA.

Timely Portfolio: LSPM Examples

Josh I have sennt a mail to your gmail address. P… Chris - May 5, 2011Josh I have sennt a mail to your gmail address. Please confirm that you have received it.

Timely Portfolio: LSPM Examples

Timely Portfolio has been doing some interesting work with Ralph Vince’s Leverage Space Model via the LSPM R package. Here’s a short list of his most recent LSPM-related posts: The Leverage Space Trading Model Bond Market as a Casino Game Part 1 Bond Market as a Casino Game Part 2 Slightly Different Use of Ralph Vince’s Leverage Space Trading Model Another Use of LSPM in Tactical Portfolio Allocation I encourage those of you who are interested in LSPM and/or R to check out his blog.

How to backtest a strategy in R

Thanks for the tutorial. However, when I ran it, … Leo - Mar 6, 2011Thanks for the tutorial. However, when I ran it, I got this error: Error: could not find function “DVI” I can’t seem to get the DVI indicator out of TTR. I’ve tried installing the package from CRAN, using install.packages(‘TTR’,dependencies=TRUE) and from r-forge, using install.packages(“TTR”,repos="http://r-forge.r-project.org”). In both cases it installs fine, and other indicators work, but there’s no DVI indicator.

How to backtest a strategy in R

This is the third post in the Backtesting in Excel and R series and it will show how to backtest a simple strategy in R. It will follow the 4 steps Damian outlined in his post on how to backtest a simple strategy in Excel. Step 1: Get the data The getSymbols function in quantmod makes this step easy if you can use daily data from Yahoo Finance. There are also “methods” (not in the strict sense) to pull data from other sources (FRED, Google, Oanda, R save files, databases, etc.

How to backtest a strategy in Excel

Good summary. This is much more efficient than c… Rocko Chen - Mar 3, 2011Good summary. This is much more efficient than coding + debugging + testing stuff in programming languages e.g. JAVA, Matlab, C++. Thanks for the comment Rocko - I think what you’ll find is that as the complexity of a model goes up, you may want to look at other approaches as well! I use the Sharpe Ratio to judge the effectivness of my investments.

How to backtest a strategy in Excel

(This is a guest post by Damian from Skill Analytics and ETF Prophet) Let me start by saying that I’m not an expert in backtesting in Excel – there are a load of very smart bloggers out there that have, as I would say, “mad skillz” at working with Excel including (but not limited to) Michael Stokes over at marketsci.com, Jeff Pietch over at etfprophet.com and the folks (David and Corey) over at cssanalytics.