#' Reset quantstrat environments \code{.strategy},
#' \code{.blotter}, and \code{.audit}.
#' Creates each of these environments if they do not exist.
#' Removes all elements from each environment.
#' Sets the global currency to USD.
reset_quantstrat <- function() {
if (! exists(".strategy")) .strategy <<- new.env(parent = .GlobalEnv)
if (! exists(".blotter")) .blotter <<- new.env(parent = .GlobalEnv)
if (! exists(".audit")) .audit <<- new.env(parent = .GlobalEnv)
suppressWarnings(rm(list = ls(.strategy), pos = .strategy))
suppressWarnings(rm(list = ls(.blotter), pos = .blotter))
suppressWarnings(rm(list = ls(.audit), pos = .audit))
FinancialInstrument::currency("USD")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.