351 search results for "quantmod"

How to backtest a strategy in R

March 26, 2011
By

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 dataThe ...

Read more »

How to backtest a strategy in R

March 26, 2011
By

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 dataThe ...

Read more »

Silver Is A Weighted Coin

March 24, 2011
By
Silver Is A Weighted Coin

editorial note: there is an error in the code explained below the code. When you flip a quarter, you normally assume the coin is fair and that there is a 50% chance of getting either heads or tails. Option pricing assumes the world of trading is f...

Read more »

Yeah Sure, Maybe, Well … Okay

March 23, 2011
By
Yeah Sure, Maybe, Well … Okay

Whoever wrote the book on statistics, probably avoided getting a proper education in literature. At least that's my null hypothesis. The cryptic and awkward presentation of probabilities common amongst the Frequentists (no, not the Latin American Socia...

Read more »

Free and Easy Currency Monitor in R

March 22, 2011
By
Free and Easy Currency Monitor in R

Certainly not the best way to keep up with currencies, but the increasingly important job of monitoring currencies can be free and easy in R using Federal Reserve FRED data.  Here is a template that can be adjusted to your favorite currencies with...

Read more »

Correlation network

March 22, 2011
By
Correlation network

I came up with an idea to draw correlation network to get a grasp about relationship between a list of stocks. An alternative way to show correlation matrix would be head map, which can have limitations with big matrices (>100). Unfortunately,  ggplot2 package doesn’t have a easy way to draw the networks, so I was left

Read more »

money is coin $ flip

March 7, 2011
By
money is coin $ flip

Well, sorta. More precisely, money is the sum of coin$flip divided by the number of coin$flip. But we'll get to that later. For now, let me introduce you to a new algorithm written in R. This one is another "quote" -- simple few lines of code -- whose ...

Read more »

Death Spiral Warning Graph

March 4, 2011
By
Death Spiral Warning Graph

In the death spiral scenario, rates go up while the currency goes down.  Here is the way to watch that.  I’m not saying that death spiral of US Dollar and interest rates occurs, but without significant action to restore confidence in fiscal...

Read more »

My R setup with Mac OS X

February 22, 2011
By
My R setup with Mac OS X

The eco-system of R is largely Ubuntu and SVN, so Mac users sometimes find themselves a bit out of place, shall we say. But let's not bad high-school memories about not being in the in-crowd keep us from participating in the R world. With just a little...

Read more »

Interest Rates’ Influence on 1987

February 21, 2011
By
Interest Rates’ Influence on 1987

One aspect of 1987 that does not deserve enough attention is interest rates.  Higher interest rates constrain economic activity and compete with other investments.  As seen in the chart below, the US 10year Treasury rate climbed 40% from 7% t...

Read more »