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
private Contract createBag(int conidOne, int conidTwo) { | |
ComboLeg leg1 = new ComboLeg(); // for the first leg | |
ComboLeg leg2 = new ComboLeg(); // for the second leg | |
Vector addAllLegs = new Vector(); | |
log.info("conid in bag "+conidOne); | |
leg1.m_conId = conidOne; | |
leg1.m_ratio = 1; | |
leg1.m_action = "BUY"; | |
leg1.m_exchange = "NYMEX"; |
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
class Spline{ | |
function Spline($x,$y){ | |
$this->hold = array(); | |
$this->hold[0] = $x; | |
$this->hold[1] = $y; | |
$y2 = Derivative2($this->hold[0],$this->hold[1]); | |
$this->hold[2] = $y2; | |
} |
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
def hurst (x): | |
""" | |
takes log returns | |
hurst exponent is you measure of "trendiness". | |
if it is going back to 0.5 that would mean your serie is loosing trendiness and behaves as a random walk again. | |
(hurst >0.5 -> autocorrelation,ie trends; hurst<0.5 -> negative aurocorrelation,ie mean reverting behavior) | |
""" | |
N=len(x) |
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 matplotlib.pyplot as plt | |
import sys | |
import networkx as nx | |
""" | |
A, B, C, AB, AC, BC. |
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 cloud | |
# http://www.picloud.com | |
def rollout (gnubgfile): | |
import commands | |
fh=cloud.files.getf(gnubgfile) | |
cmds = fh.readlines() | |
pp=open('tmpfile.txt','w') | |
pp.writelines(cmds) | |
pp.close() |
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
""" | |
http://www.market-topology.com | |
wsdl service | |
""" | |
from suds.client import Client | |
url='https://api.impactopia.com/ImpactopiaWS0.5/ImpactopiaWS?wsdl' | |
client = Client(url) | |
client.service.login('blahlogin','blahpass') | |
client.service.getStock('AAPL') |
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 | |
class MatchEquity(object): | |
def __init__ (self): | |
#rockwell kazaross match equity table | |
self.met = np.matrix([ [ 0, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], | |
[ 100, 50, 68, 75, 81, 84, 89, 91, 93, 94, 96, 97, 98, 98, 98, 99, 50], | |
[ 100, 32, 50, 60, 67, 74, 80, 84, 87, 90, 92, 94, 95, 96, 97, 98, 49], |
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
from PyQt4 import QtCore,QtGui | |
import sys,os,signal | |
from dropbox import client, rest, session | |
class ddbackup(object): | |
def __init__ (self): | |
# Get your app key and secret from the Dropbox developer website | |
self.APP_KEY = 'xsdU786dsfsf' | |
self.APP_SECRET = 'sfsLO3fsf' |
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 cloud | |
from QuantLib import * | |
import datetime,dateutil | |
def OptionCalculator(strike,und,opttype,vola,expiry): | |
dateoffset = 0 | |
# global data | |
today = datetime.date.today() + datetime.timedelta(days= dateoffset) |
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
from nose import with_setup # optional | |
from unnecessary_math import multiply | |
def setup_module(module): | |
print ("") # this is to get a newline after the dots | |
print ("setup_module before anything in this file") | |
def teardown_module(module): |
OlderNewer