Skip to content

Instantly share code, notes, and snippets.

View QuantTraderEd's full-sized avatar
🤔
Let me think..

QuantTraderEd

🤔
Let me think..
View GitHub Profile
@QuantTraderEd
QuantTraderEd / read_shortcd.py
Last active August 29, 2015 14:18
web scraping
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 12:45:04 2015
@author: assa
"""
def read_shortcd(filename='kospi.text'):
shortcd_lst = []
@QuantTraderEd
QuantTraderEd / FO_impliedR.py
Created May 3, 2015 09:04
calcuate futures&options implied interest rate
from sympy import *
c, p, K, F, T1, T2, r = symbols('c, p, K, F, T1, T2, r')
eq = c - p - F / (1 + r * T2) + K / (1 + r * T1)
ans = solve(eq,r)
@QuantTraderEd
QuantTraderEd / EigenPort2.py
Last active August 29, 2015 14:20
EigenPort
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 12:44:08 2015
@author: assa
"""
import numpy as np
import pandas as pd
@QuantTraderEd
QuantTraderEd / ETFArbTest.py
Last active August 29, 2015 14:21
ETFArbTest
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 11:07:33 2015
@author: assa
"""
import pandas as pd
import sqlite3 as lite
import numpy as np
import time
m1 = np.mat(np.random.rand(2800, 2800))
m2 = np.mat(np.random.rand(2800, 2800))
t = time.time(); m3 = m1 * m2; print time.time() - t
@QuantTraderEd
QuantTraderEd / Makefile
Last active August 29, 2015 14:23
R stat
SrcSuf = cxx
ObjSuf = o
OutPutOpt = -o
SoSuf = so
#=======================================
R_HOME := $(shell R RHOME)
RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflgs)
RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
RBLAS := $(shell $(R_HOME)/bin/R CMD config BLAS_LIBS)
@QuantTraderEd
QuantTraderEd / lypython.hpp
Last active December 31, 2019 14:51
boost python helper
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <vector>
#include <unordered_map>
namespace lymc {
namespace python = boost::python;
@QuantTraderEd
QuantTraderEd / file1.txt
Created May 31, 2017 14:14
Created via API
Demo
@QuantTraderEd
QuantTraderEd / pgist.py
Created May 31, 2017 15:19
scipt what upload file to gist
# -*- coding: utf-8 -*-
import json
filename = 'pgist.py'
# 1. make content
with open(filename, 'r') as f:
line_lst = f.readlines()
@QuantTraderEd
QuantTraderEd / test_text.txt
Created June 1, 2017 14:58
Create via API
test_text