Skip to content

Instantly share code, notes, and snippets.

'''
Created on Nov 25, 2011
@author: tlmaloney
'''
class Agent(object):
'''
An Agent has a name and Unique ID.
'''
@tlmaloney
tlmaloney / Market.py
Created December 6, 2011 18:56
Market class
'''
Created on Nov 25, 2011
@author: tlmaloney
'''
class Market(object):
'''
A market provides information about observables, like Assets, Prices,
Agents, DiscountFactorCurves, etc.
@tlmaloney
tlmaloney / Price.py
Created December 7, 2011 04:26
Price class
'''
Created on Nov 26, 2011
@author: tlmaloney
'''
import Payment
class Price(object):
'''
@tlmaloney
tlmaloney / Payment.py
Created December 7, 2011 19:53
Payment class
'''
Created on Nov 25, 2011
@author: tlmaloney
'''
class Payment(object):
'''
A payment is the transfer of ownership and possession of an amount of asset from Agent A to
Agent B on a specific date.
@tlmaloney
tlmaloney / func_names.cpp
Created December 14, 2011 04:34
Implied volatility for American Options
/*
* func_names.cpp
*
* Created on: Dec 1, 2011
* Author: tlmaloney
*/
#include "func_names.h"
// boundary condition along tau_final
@tlmaloney
tlmaloney / InterestPayment.py
Created August 12, 2012 00:15
InterestPayment class
class InterestPayment(SeriesPayment):
""" One of a series of rate-based payments """
def __init__(self, rate_level_model, measure, period, inception_date, payment_date,
interest, asset_id, name, description):
SeriesPayment.__init__(self, inception_date, payment_date, interest,
asset_id, name, description)
self.rate_level_model = rate_level_model
self.measure = measure
self.period = period
@tlmaloney
tlmaloney / DateMeasure.py
Created August 12, 2012 00:47
DateMeasure class
class DateMeasure(object):
"""An abstract base class for date measures"""
name = None
def measure_time(self, date, schedule):
'''Returns a measure of time between date and
schedule.prev_date(date)
Keyword arguments:
@tlmaloney
tlmaloney / DateMeasureKit.py
Created August 12, 2012 04:40
DateMeasure
'''
:Name: DateMeasureKit
:Descr: The way we make calculations based on the number of days between two dates
:Synopsis: Contains a set of conventions for determining the day-count between two dates. Finds both the number of days between two dates and the corresponding day count factor.
:Author: dpollini
tmaloney
#!/bin/bash
# This hook is run after a new virtualenv is activated.
# ~/.virtualenvs/postmkvirtualenv
libs=( PyQt4 sip.so )
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))")
var=( $(which -a $python_version) )
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
(mint)tmaloney@pear-08:~/hgdev/org.bitbucket/tlmaloney/sbrohme-python$ python gruen/fincad/curves/eur_swap_3m_hist.py 20121011
Value Date: 41375.0
(2011, 5, 19, 0, 0, 0)
(2011, 5, 20, 0, 0, 0)
(2011, 5, 23, 0, 0, 0)
(2011, 5, 24, 0, 0, 0)
(2011, 5, 25, 0, 0, 0)
(2011, 5, 26, 0, 0, 0)
(2011, 5, 27, 0, 0, 0)
(2011, 5, 30, 0, 0, 0)