This file contains hidden or 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 scipy.stats as ss | |
import time,calendar | |
import math | |
from sklearn.decomposition import PCA | |
import statsmodels.api as sm | |
This file contains hidden or 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
#!/usr/bin/env python | |
__author__ = 'Kevin Warrick' | |
__email__ = '[email protected]' | |
import cPickle | |
from functools import wraps | |
def redis_lru(capacity=5000, slice=slice(None)): | |
""" | |
Simple Redis-based LRU cache decorator *. |
This file contains hidden or 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 pykka | |
import pykka.gevent | |
class Worker(pykka.gevent.GeventActor): | |
def __init__(self, **kwargs): | |
super(Worker, self).__init__() | |
self.inputs = kwargs.get('inputs') | |
def on_receive(self, message): |
This file contains hidden or 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
class Utils(object): | |
months=['','F','G','H','J','K','M','N','Q','U','V','X','Z'] | |
@staticmethod | |
def localsymbol (expiry,right,strike): | |
exp = Utils.months[1+ int(expiry)/100%100 ] | |
s= strike*1000 | |
sym="ON%s2 %s%s" %(exp,right,str(s)[:-2]) | |
return sym |
This file contains hidden or 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 pykka | |
import pykka.gevent | |
import gevent | |
import numpy as np | |
import copy,sys, pprint , blist | |
from collections import defaultdict | |
import logging | |
import signal |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
# | |
# TsTables -- High Frequency Times Series Data with PyTables | |
# | |
# to install -- pip install tstables | |
# Github repo -- https://github.com/afiedler/tstables | |
# | |
# Dr. Yves J. Hilpisch | |
# | |
# The Python Quants GmbH | |
# http://quant-platform.com |
This file contains hidden or 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 seaborn | |
import pandas as pd | |
import numpy as np | |
import matplotlib.patches as mpatches | |
#create random trade pnls | |
n = 5000 | |
sigma = .1 | |
pnl1 = pd.DataFrame(np.random.randn(n,15)) * sigma |
This file contains hidden or 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 seaborn | |
import pandas as pd | |
import numpy as np | |
import matplotlib.patches as mpatches | |
#create random trade pnls | |
n = 5000 | |
sigma = .1 | |
pnl1 = pd.DataFrame(np.random.randn(n,15)) * sigma |
This file contains hidden or 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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:3338a1daefbcc568033180ef3e8f67027da32f0fd4d4ffbfeffdfc2149397bc1" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
NewerOlder