Skip to content

Instantly share code, notes, and snippets.

############################################################
## Using Genetic Algorithms in Quantitative Trading
##
## [email protected] - Mar 2014
############################################################
library(PerformanceAnalytics)
library(rgenoud)
library(quantmod)
library(TTR)

rCharts + dimplejs Visualization of bfast on S&P 500

Interactively analyze the effect of h on the R package bfast breakpoints with a d3.js visualization using rCharts.

Code to replicate and more

Original R bfast code from blog post

For a better understanding of bfast please see the following paper.

@stena
stena / 0_reuse_code.js
Created December 31, 2013 15:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stena
stena / fmincg.py
Created December 31, 2013 15:02
Minimize a continuous differentiable multivariate function.
# -*- coding: cp1252 -*-
# Minimize a continuous differentialble multivariate function. Starting point
# is given by "X" (D by 1), and the function named in the string "f", must
# return a function value and a vector of partial derivatives. The Polack-
# Ribiere flavour of conjugate gradients is used to compute search directions,
# and a line search using quadratic and cubic polynomial approximations and the
# Wolfe-Powell stopping criteria is used together with the slope ratio method
# for guessing initial step sizes. Additionally a bunch of checks are made to
# make sure that exploration is taking place and that extrapolation will not