Skip to content

Instantly share code, notes, and snippets.

View jaymon0703's full-sized avatar

Jasen Mackie jaymon0703

View GitHub Profile
@jaymon0703
jaymon0703 / mcsimr.R
Last active May 21, 2016 13:39
A Monte Carlo Simulation function for your back-test results - in R
# Record script start time ----------------------------------------
t1 <- Sys.time()
# Load required packages ------------------------------------------
library(quantmod)
library(TTR)
library(PerformanceAnalytics)
library(ggplot2)
library(timeSeries)
@jaymon0703
jaymon0703 / mcblocksim.R
Last active April 26, 2016 22:31
Monte Carlo Simulation with Block Bootstrapping
# Record script start time ----------------------------------------
t1 <- Sys.time()
# Load required packages ------------------------------------------
library(quantmod)
# Build the function ----------------------------------------------
mcblocksim <- function(R, l){
# Read price data and build xts object