aboutsummaryrefslogtreecommitdiffstats
path: root/python/trade_template.py
blob: dce5081e186c078c3bfe2275ddef383a86350c1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)