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
library(plyr) | |
library(lubridate) | |
library(reshape) | |
library(zoo) | |
library(forecast) | |
#Input data | |
startdate <- mdy("01-01-2013") | |
enddate <- mdy("04-13-2014") | |
freq <- "d" #daily |
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
>>>from numpy import * | |
>>> # Define a matrix X that has 3 column vectors as the observations variables | |
>>> X = array([[1, 2, 3], [2, 4, 5], [1, 2, 5], [10,2,3], [25,23,1]]) | |
>>> X | |
array([[ 1, 2, 3], | |
[ 2, 4, 5], | |
[ 1, 2, 5], | |
[10, 2, 3], | |
[25, 23, 1]]) | |
>>> # Calculate covariance matrix |
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
# | |
# $Id: bcp_out_all_tables.py 22322 2013-04-01 18:05:06Z neerav1985 $ | |
# | |
import sys | |
import argparse | |
import textwrap | |
import workerpool | |
import commands | |
import logging |
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
''' | |
Created on Oct 26, 2013 | |
@author: pokerface | |
This code gets the spot price and options data from NSE India(www.nseindia.com) website | |
''' | |
import urllib2 |
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
#install.packages(c("twitteR","ROAuth","tm","wordcloud","RXKCD")) | |
library(twitteR) | |
library(ROAuth) | |
library(plyr) | |
library(RXKCD) | |
library(tm) | |
library(wordcloud) | |
library(RColorBrewer) |
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
from numpy import * | |
from scipy.stats import norm | |
from scipy.optimize import root, fsolve, newton | |
import logging | |
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG) | |
def BlackScholesCall(S, K, T, sigma, r = 0., q = 0.): | |
#logging.debug("S=" + str(S) + ",K=" + str(K) + ",T=" + str(T) + ",sigma=" + str(sigma) + ",r=" + str(r) + ",q=" + str(q) ) |
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 cx_Oracle | |
import logging | |
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG) | |
if __name__ == "__main__": | |
conn = cx_Oracle.connect(user,password,server) | |
cursor = conn.cursor() |