Articles by s3admq

R-ratio vs mean-variance optimization

July 4, 2013 | s3admq

I am looking at the following tickers from 2005-01-01 to 2008-01-01. The tickers are GE, F, MSFT, DELL, INTC. I will find the mean-variance weights and the R-ratio weights and then test portfolio performance from 2008-01-01 to 2010-01-01. This is a … Continue reading → [Read more...]

Graphing with fPortfolio

June 27, 2013 | s3admq

Now to making pretty-looking graphs and charts for portfolio optimization! The first thing we will do is determine the frontier for our combination of securities. Remember, the variable returnsMatrix below is a matrix of returns for all the securities in … Continue reading → [Read more...]

Portfolio Optimization with fPortfolio

June 27, 2013 | s3admq

fPortfolio contains a number of function to make portfolio optimization easier. I can compare the results I get from the functions in fPortfolio to the results from my function from the previous post. I don’t expect them to be exactly … Continue reading → [Read more...]

Portfolio Optimization

June 27, 2013 | s3admq

Changing tracks, I want to now look at portfolio optimization. Although this is very different from developing trading strategies, it is useful to know how to construct minimum-variance portfolios and the like, if only for curiosity’s sake. Also, just a … Continue reading → [Read more...]

Parameter Optimization for Strategy 2

June 27, 2013 | s3admq

Now, let’s try some parameter optimisation for the SMA strategy! There probably are functions out there on R which I can use to do this, but I figured it would take me as long to actually code it as it … Continue reading → [Read more...]

Strategy 2: Riding the SMA Curve

June 26, 2013 | s3admq

This is the least complicated trend strategy in existance. You buy and hold the security as long as the security price is above a XXX-Day Simple Moving Average (SMA), and you can short it if it is below the SMA … Continue reading → [Read more...]

Strategy 1 Extended (Part 2)

June 26, 2013 | s3admq

We can extend our strategy and make it more profitable by incorporating short selling. Our annualized volatility will go up, but it will be interesting to see what happens to the annualized return. This is a very simple modification to … Continue reading → [Read more...]

Strategy 1 Extended (Part 1)

June 26, 2013 | s3admq

Like I said in my previous post, there are two ways I could think of, off the top of my head, to implement a 2-day or 5-day extension to the previous strategy. One way would be just a simple extension … Continue reading → [Read more...]

Trading Strategy 1: What goes up, goes up…

June 26, 2013 | s3admq

As I said earlier, my main task at my internship is to hunt for profitable strategies. As you can imagine, strategies can range from the exceedingly simple and easy to implement, to the crazily complex. Let’s start out with one … Continue reading → [Read more...]

Looking out for volatility

June 26, 2013 | s3admq

Let’s do an easy experiment. Lets caluclate the 25-day rolling volatility of the S&P 500 from 2007 onwards. 1-Get the data: getSymbols(‘SPY’,from=’2007/01/01′) 2-Run the volatility function from the package TTR (comes along with quantmod): vol=volatility(SPY,n=25,N=252,calc=’close’) #n=25 means we want 25 … Continue reading → [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)