sudo apt-get install sbcl
curl -O http://beta.quicklisp.org/quicklisp.lisp
sbcl --load quicklisp.lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A few helper functions | |
def calcReturns(df): | |
# Helper function to avoid repeating too much code | |
df['returns'] = df['Close'] / df['Close'].shift(1) | |
df['log_returns'] = np.log(df['returns']) | |
df['strat_returns'] = df['position'].shift(1) * df['returns'] | |
df['strat_log_returns'] = df['position'].shift(1) * \ | |
df['log_returns'] | |
df['cum_returns'] = np.exp(df['log_returns'].cumsum()) - 1 | |
df['strat_cum_returns'] = np.exp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defsystem :cl-docker | |
:depends-on (:cl-ppcre) | |
:serial t | |
:components ((:file "package") | |
(:file "docker"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as pl | |
from numpy import fft | |
def fourierExtrapolation(x, n_predict): | |
n = x.size | |
n_harm = 10 # number of harmonics in model | |
t = np.arange(0, n) | |
p = np.polyfit(t, x, 1) # find linear trend in x | |
x_notrend = x - p[0] * t # detrended x |
1. Install a Common Lisp implementation, or several of them
- SBCL for Windows with threads: https://github.com/akovalenko/sbcl-win32-threads/wiki
- CLISP is slow, and singlethreaded but makes relatively small binaries
- CCL is reportedly good?
2. Install Emacs. Official GNU Emacs Windows binaries should work: http://ftp.gnu.org/gnu/emacs/windows/
3. Create a directory where you will store your Lisp projects (you could use Quicklisp's default one but screw that, "c:/lisp" is better than "c:/users/<username>/quicklisp/local-projects")