diff options
| -rw-r--r-- | python/templates/trading_form.tex | 66 | ||||
| -rw-r--r-- | python/trade_template.py | 33 |
2 files changed, 99 insertions, 0 deletions
diff --git a/python/templates/trading_form.tex b/python/templates/trading_form.tex new file mode 100644 index 00000000..62f95a8c --- /dev/null +++ b/python/templates/trading_form.tex @@ -0,0 +1,66 @@ +\documentclass[11pt]{article} +\usepackage{parskip} +\usepackage{geometry} +\begin{document} +\begin{center} +\Large +Pending Trade Notice +\end{center} + +\vspace{1cm} +Date: $date +\\ +\begin{flushleft} +\begin{tabular}{@{}l l} +To: & Global Custody and Agency Services\\ + & Fax \#: (312) 904-0990 +\end{tabular} +\end{flushleft} +\vspace{0.5cm} +Account Number: ${account_number}\hspace{1cm} From: ${trader_name}, Serenitas Capital LP +\\ +\\ +Acount Name: Serenitas Credit Gamma Master Fund LP\hspace{1cm} Signature: +\\ +\\ +\\ +\textbf{Trade Details:} + +\begin{center} +\begin{tabular}{@{}p{5cm} p{5cm} p{5cm}} +\textbf{Trade Type: (check one)} & \textbf{Currency} & \textbf{Settlement}\\[0.5cm] + +$tradetype_rf Receive Free & $currency_USD USD & $settle_DTC DTC\\ +$tradetype_df Deliver Free & $currency_EURO EURO & $settle_FED FED\\ +$tradetype_sell DVP (Sell) & $currency_CAD CAD & $settle_EUROCLEAR EUROCLEAR\\ +$tradetype_buy RVP (Buy) & $currency_YEN YEN & $settle_LOCAL LOCAL MARKET\\ +\end{tabular} +\end{center} + +\vspace{0.5cm} +\textbf{Security Description} +\begin{flushleft} +\begin{tabular}{@{}l l} +Cusip/Isin: & $id_security\\ +Class Name: & $class_security\\ +Trade Date: & $trade_date\\ +Settlement Date: & $settle_date\\ +Current Face Value: & $curr_face\\ +Original Face Value: & $orig_face\\ +Principal: & $principal\\ +Accrued Interest: & $interest\\ +Commission: & $commission\\ +Net Amount: & $net_amount\\ +\end{tabular} +\end{flushleft} + +\textbf{Counterparty Information} +\begin{flushleft} +\begin{tabular}{@{}l l} +Counterparty Account: &\\ +Counterparty Name: &\\ +Counterparty Contact \& Phone Number: &\\ +\end{tabular} +\end{flushleft} + +\end{document} diff --git a/python/trade_template.py b/python/trade_template.py new file mode 100644 index 00000000..dce5081e --- /dev/null +++ b/python/trade_template.py @@ -0,0 +1,33 @@ +from string import Template + +default = "\underline{\hspace{1cm}}" +checked = "\underline{\hspace{0.35cm}X\hspace{0.35cm}}" +d = {} +d['account_number'] = "602382.3" +d['trader_name'] = 'Guillaume Horel' +for tradetype in ['rf', 'df', 'sell', 'buy']: + d['tradetype_'+tradetype] = default +for currency in ['USD', 'EURO', 'CAD', 'YEN']: + d['currency_'+currency] = default +for settle in ['DTC', 'FED', 'EUROCLEAR', 'LOCAL']: + d['settle_'+settle] = default +d['tradetype_buy'] = checked +d['currency_USD'] = checked +d['settle_DTC'] = checked +d['id_security'] = '45670AAA9' +d['class_security'] = 'C' +d['settle_date'] = '2013-05-18' +d['date'] = '2013-05-18' +d['trade_date'] = '2013-05-18' +d['curr_face'] = "1000000" +d['orig_face'] = "1000000" +d['principal'] = "1000000" +d['interest'] = "10000" +d['commission'] = "0" +d['net_amount'] = "0" +with open("templates/trading_form.tex", "r") as fh: + texfile = Template(fh.read()) + texfile = texfile.substitute(d) + +with open("templates/trading_form_filled.tex", "w") as fh: + fh.write(texfile) |
