9.1 Install standard packages

Before we start, let us make sure that we have installed the following four standard packages:

  1. quantmod,
  2. PerformanceAnalytics,
  3. FinancialInstrument, and
  4. foreach.

If your R does not have them, please run the following code:

install.packages("quantmod")
install.packages("FinancialInstrument")
install.packages("PerformanceAnalytics")
install.packages("foreach")

FinancialInstrument allows you to specify your assets class (e.g., stock, derivatives, currency) and foreach is a package that allow fast computation (i.e., parallel computation).