calc_profit 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/Gemfile +3 -0
- data/Install +4 -0
- data/README.rdoc +23 -0
- data/Rakefile +13 -0
- data/bin/calc_profit +75 -0
- data/bin/do-demo.sh +7 -0
- data/bin/easters.rb +17 -0
- data/bin/tm-profit.rb +60 -0
- data/calc_profit.gemspec +39 -0
- data/examples/Trans.csv +92 -0
- data/examples/driver.tex +16 -0
- data/examples/lopez.csv +34 -0
- data/examples/profit.lp +93 -0
- data/examples/solution.out +814 -0
- data/lib/calc_profit.rb +14 -0
- data/lib/calc_profit/core_ext.rb +2 -0
- data/lib/calc_profit/core_ext/array.rb +10 -0
- data/lib/calc_profit/core_ext/string.rb +32 -0
- data/lib/calc_profit/latex_table_builder.rb +182 -0
- data/lib/calc_profit/match.rb +57 -0
- data/lib/calc_profit/table.rb +151 -0
- data/lib/calc_profit/transaction.rb +50 -0
- data/lib/calc_profit/transaction_group.rb +181 -0
- data/lib/calc_profit/version.rb +7 -0
- data/test/TestAddress.rb +23 -0
- data/test/TestDBase.rb +47 -0
- data/test/TestDate.rb +267 -0
- data/test/TestLog.rb +19 -0
- data/test/TestName.rb +110 -0
- data/test/TestRetriever.rb +38 -0
- data/test/TestString.rb +12 -0
- data/test/TestTeXString.rb +12 -0
- data/test/TestTransaction.rb +56 -0
- data/test/Trans.csv +92 -0
- data/test/tabdemo-tm.tex +37 -0
- data/test/tabdemo.tex +37 -0
- data/test/tables-tm.tex +235 -0
- data/test/tables.tex +235 -0
- data/test/test_helper.rb +38 -0
- metadata +222 -0
data/test/tables.tex
ADDED
@@ -0,0 +1,235 @@
|
|
1
|
+
\providecommand{\RawTransTable}{}
|
2
|
+
\renewcommand{\RawTransTable}{\begin{longtable}{llccrr}
|
3
|
+
\hline\\[0.5ex]
|
4
|
+
\textbf{Ref}&\textbf{Info}&\textbf{Date}&\textbf{Code}&\textbf{Price}&\textbf{Unadj Shares}\\
|
5
|
+
\hline\\[0.5ex]
|
6
|
+
\endhead
|
7
|
+
&\\
|
8
|
+
\endlastfoot
|
9
|
+
\textbf{0001}&2006-08-09-1-I&2006-05-02&P&8.6000&5,000\\
|
10
|
+
\textbf{0002}&2006-08-09-1-I&2006-05-03&P&8.4200&5,000\\
|
11
|
+
\textbf{0003}&2006-08-09-1-I&2006-05-04&P&8.4000&5,000\\
|
12
|
+
\textbf{0004}&2006-08-09-1-D&2006-05-10&P&8.0200&8,600\\
|
13
|
+
\textbf{0005}&2006-08-09-1-D&2006-05-12&P&7.2500&10,000\\
|
14
|
+
\textbf{0006}&2006-08-09-1-I&2006-05-12&P&6.7400&2,000\\
|
15
|
+
\textbf{0007}&2006-08-09-1-D&2006-05-16&P&7.0000&5,000\\
|
16
|
+
\textbf{0008}&2006-08-09-1-D&2006-05-17&P&6.7000&5,000\\
|
17
|
+
\textbf{0009}&2006-08-09-1-I&2006-05-17&P&6.7400&2,000\\
|
18
|
+
\textbf{0010}&2006-08-09-1-I&2006-05-19&P&7.2500&1,000\\
|
19
|
+
\textbf{0011}&2006-08-09-1-I&2006-05-19&P&7.2500&1,000\\
|
20
|
+
\textbf{0012}&2006-08-09-1-I&2006-05-31&P&7.9200&2,000\\
|
21
|
+
\textbf{0013}&2006-08-09-1-I&2006-06-05&P&7.9200&1,000\\
|
22
|
+
\textbf{0014}&2006-08-09-1-I&2006-06-15&P&6.9800&5,000\\
|
23
|
+
\textbf{0015}&2006-08-09-1-I&2006-06-16&P&6.9300&1,000\\
|
24
|
+
\textbf{0016}&2006-08-09-1-I&2006-06-16&P&6.9400&1,000\\
|
25
|
+
\textbf{0017}&2006-08-09-1-I&2006-06-29&P&7.0000&4,000\\
|
26
|
+
\textbf{0018}&2006-08-09-1-D&2006-07-14&P&6.2000&2,000\\
|
27
|
+
\textbf{0019}&2006-08-09-1-D&2006-08-03&P&4.3900&1,400\\
|
28
|
+
\textbf{0020}&2006-08-09-1-D&2006-08-07&P&4.5900&1,100\\
|
29
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&16,000\\
|
30
|
+
\textbf{0022}&2006-08-21-1-I&2006-08-08&S&4.7000&16,000\\
|
31
|
+
\textbf{0023}&2006-08-21-1-D&2006-08-15&P&4.8000&16,000\\
|
32
|
+
\textbf{0024}&2006-08-21-1-I&2006-08-15&S&4.8000&16,000\\
|
33
|
+
\textbf{0025}&2006-08-21-1-I&2006-08-16&P&5.2900&2,100\\
|
34
|
+
\textbf{0026}&2006-08-21-1-I&2006-08-17&P&5.7000&2,900\\
|
35
|
+
\textbf{0027}&2006-08-25-1-D&2006-08-23&P&5.2400&8,000\\
|
36
|
+
\textbf{0028}&2006-08-29-1-I&2006-08-23&S&5.2400&8,000\\
|
37
|
+
\textbf{0029}&2006-08-29-1-D&2006-08-28&P&5.4000&1,000\\
|
38
|
+
\textbf{0030}&2006-08-30-1-D&2006-08-29&P&5.4000&2,000\\
|
39
|
+
\textbf{0031}&2006-08-30-1-I&2006-08-29&S&5.4000&2,000\\
|
40
|
+
\textbf{0032}&2006-09-06-1-I&2006-09-05&P&5.7500&2,700\\
|
41
|
+
\textbf{0033}&2006-09-15-1-D&2006-09-11&P&5.7200&4,000\\
|
42
|
+
\textbf{0034}&2006-09-15-1-I&2006-09-11&S&5.7200&4,000\\
|
43
|
+
\textbf{0035}&2006-09-15-2-I&2006-09-12&P&5.4800&3,000\\
|
44
|
+
\textbf{0036}&2006-09-15-2-I&2006-09-13&P&5.4100&1,700\\
|
45
|
+
\textbf{0037}&2006-09-21-1-I&2006-09-20&P&5.4900&7,500\\
|
46
|
+
\textbf{0038}&2006-12-11-1-I&2006-12-07&S&7.8900&6,000\\
|
47
|
+
\textbf{0039}&2006-12-11-1-I&2006-12-11&S&8.0000&100\\
|
48
|
+
\textbf{0040}&2007-04-27-1-I&2007-01-29&P&12.1000&2,500\\
|
49
|
+
\textbf{0041}&2007-04-27-1-I&2007-01-31&P&13.7000&2,500\\
|
50
|
+
\textbf{0042}&2007-04-27-1-I&2007-02-02&P&15.1500&4,000\\
|
51
|
+
\textbf{0043}&2007-04-27-1-I&2007-02-06&P&14.9500&5,000\\
|
52
|
+
\textbf{0044}&2007-04-27-1-I&2007-02-07&P&15.0000&400\\
|
53
|
+
\textbf{0045}&2007-04-27-1-I&2007-02-08&P&15.0000&4,600\\
|
54
|
+
\textbf{0046}&2007-04-27-1-I&2007-02-12&P&14.9100&3,500\\
|
55
|
+
\textbf{0047}&2007-04-27-1-D&2007-02-13&P&14.6500&1,500\\
|
56
|
+
\textbf{0048}&2007-04-27-1-D&2007-02-14&P&14.4900&2,000\\
|
57
|
+
\textbf{0049}&2007-04-27-1-I&2007-02-15&P&14.3000&3,000\\
|
58
|
+
\textbf{0050}&2007-04-27-1-D&2007-02-21&P&14.6500&8,500\\
|
59
|
+
\textbf{0051}&2007-04-27-1-I&2007-02-21&S&14.6500&8,500\\
|
60
|
+
\textbf{0052}&2007-04-27-1-I&2007-02-22&P&14.8800&1,500\\
|
61
|
+
\textbf{0053}&2007-04-27-1-I&2007-02-23&P&14.9700&3,000\\
|
62
|
+
\textbf{0054}&2007-04-27-1-I&2007-02-23&P&14.9700&5,000\\
|
63
|
+
\textbf{0055}&2007-04-27-1-I&2007-02-27&P&13.8800&5,200\\
|
64
|
+
\textbf{0056}&2007-04-27-1-D&2007-02-28&P&13.0000&6,700\\
|
65
|
+
\textbf{0057}&2007-04-27-1-I&2007-02-28&P&13.0000&800\\
|
66
|
+
\textbf{0058}&2007-04-27-1-I&2007-02-28&P&13.0000&8,400\\
|
67
|
+
\textbf{0059}&2007-04-27-1-D&2007-03-01&P&12.2500&2,500\\
|
68
|
+
\textbf{0060}&2007-04-27-1-D&2007-03-05&P&11.9700&1,800\\
|
69
|
+
\textbf{0061}&2007-04-27-1-D&2007-03-06&P&12.1300&500\\
|
70
|
+
\textbf{0062}&2007-04-27-1-D&2007-03-07&P&12.3700&3,000\\
|
71
|
+
\textbf{0063}&2007-04-27-1-I&2007-03-08&P&12.6000&2,000\\
|
72
|
+
\textbf{0064}&2007-04-27-1-I&2007-03-09&P&12.8100&7,700\\
|
73
|
+
\textbf{0065}&2007-04-27-1-I&2007-03-12&P&12.4600&4,200\\
|
74
|
+
\textbf{0066}&2007-04-27-1-I&2007-03-13&P&12.2500&800\\
|
75
|
+
\textbf{0067}&2007-04-27-2-I&2007-03-19&P&14.5500&2,000\\
|
76
|
+
\textbf{0068}&2007-04-27-2-I&2007-03-19&P&14.5500&5,000\\
|
77
|
+
\textbf{0069}&2007-04-27-2-I&2007-03-19&P&14.3300&2,000\\
|
78
|
+
\textbf{0070}&2007-04-27-2-I&2007-03-20&P&14.4600&1,000\\
|
79
|
+
\textbf{0071}&2007-04-27-2-I&2007-03-20&P&14.4600&1,500\\
|
80
|
+
\textbf{0072}&2007-04-27-2-I&2007-03-21&P&16.9000&3,900\\
|
81
|
+
\textbf{0073}&2007-04-27-1-D&2007-03-23&P&14.9700&8,000\\
|
82
|
+
\textbf{0074}&2007-04-27-2-I&2007-03-27&P&16.9300&1,000\\
|
83
|
+
\textbf{0075}&2007-04-27-2-D&2007-03-28&P&16.5000&1,000\\
|
84
|
+
\textbf{0076}&2007-04-27-2-D&2007-03-29&P&16.2500&1,000\\
|
85
|
+
\textbf{0077}&2007-04-27-2-I&2007-04-04&P&17.8600&200\\
|
86
|
+
\textbf{0078}&2007-04-27-2-I&2007-04-04&P&19.5000&2,000\\
|
87
|
+
\textbf{0079}&2007-04-27-2-I&2007-04-04&P&19.1300&3,000\\
|
88
|
+
\textbf{0080}&2007-04-27-2-I&2007-04-05&P&19.1500&1,000\\
|
89
|
+
\textbf{0081}&2007-04-27-2-I&2007-04-10&P&20.7500&2,000\\
|
90
|
+
\textbf{0082}&2007-04-27-2-I&2007-04-11&P&20.5000&1,000\\
|
91
|
+
\textbf{0083}&2007-04-27-2-I&2007-04-12&P&21.5000&600\\
|
92
|
+
\textbf{0084}&2007-04-27-2-I&2007-04-12&P&21.4500&1,000\\
|
93
|
+
\textbf{0085}&2007-04-27-2-I&2007-04-13&P&21.5000&2,100\\
|
94
|
+
\textbf{0086}&2007-04-27-2-I&2007-04-16&P&22.6000&500\\
|
95
|
+
\textbf{0087}&2007-04-27-2-D&2007-04-17&P&23.5500&3,500\\
|
96
|
+
\textbf{0088}&2007-04-27-2-I&2007-04-17&S&23.5500&3,500\\
|
97
|
+
\textbf{0089}&2007-04-27-2-I&2007-04-23&P&23.4500&5,000\\
|
98
|
+
\textbf{0090}&2007-04-27-2-I&2007-04-24&P&24.3000&5,000\\
|
99
|
+
\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&10,000\\
|
100
|
+
\end{longtable}
|
101
|
+
}
|
102
|
+
\providecommand{\TransTable}{}
|
103
|
+
\renewcommand{\TransTable}{\begin{longtable}{llccrr}
|
104
|
+
\hline\\[0.5ex]
|
105
|
+
\textbf{Ref}&\textbf{Info}&\textbf{Date}&\textbf{Code}&\textbf{Price}&\textbf{Shares}\\
|
106
|
+
\hline\\[0.5ex]
|
107
|
+
\endhead
|
108
|
+
&\\
|
109
|
+
\endlastfoot
|
110
|
+
\textbf{0001}&2006-08-09-1-I&2006-05-02&P&8.6000&5,000\\
|
111
|
+
\textbf{0002}&2006-08-09-1-I&2006-05-03&P&8.4200&5,000\\
|
112
|
+
\textbf{0003}&2006-08-09-1-I&2006-05-04&P&8.4000&5,000\\
|
113
|
+
\textbf{0004}&2006-08-09-1-D&2006-05-10&P&8.0200&8,600\\
|
114
|
+
\textbf{0005}&2006-08-09-1-D&2006-05-12&P&7.2500&10,000\\
|
115
|
+
\textbf{0006}&2006-08-09-1-I&2006-05-12&P&6.7400&2,000\\
|
116
|
+
\textbf{0007}&2006-08-09-1-D&2006-05-16&P&7.0000&5,000\\
|
117
|
+
\textbf{0008}&2006-08-09-1-D&2006-05-17&P&6.7000&5,000\\
|
118
|
+
\textbf{0009}&2006-08-09-1-I&2006-05-17&P&6.7400&2,000\\
|
119
|
+
\textbf{0010}&2006-08-09-1-I&2006-05-19&P&7.2500&1,000\\
|
120
|
+
\textbf{0011}&2006-08-09-1-I&2006-05-19&P&7.2500&1,000\\
|
121
|
+
\textbf{0012}&2006-08-09-1-I&2006-05-31&P&7.9200&2,000\\
|
122
|
+
\textbf{0013}&2006-08-09-1-I&2006-06-05&P&7.9200&1,000\\
|
123
|
+
\textbf{0014}&2006-08-09-1-I&2006-06-15&P&6.9800&5,000\\
|
124
|
+
\textbf{0015}&2006-08-09-1-I&2006-06-16&P&6.9300&1,000\\
|
125
|
+
\textbf{0016}&2006-08-09-1-I&2006-06-16&P&6.9400&1,000\\
|
126
|
+
\textbf{0017}&2006-08-09-1-I&2006-06-29&P&7.0000&4,000\\
|
127
|
+
\textbf{0018}&2006-08-09-1-D&2006-07-14&P&6.2000&2,000\\
|
128
|
+
\textbf{0019}&2006-08-09-1-D&2006-08-03&P&4.3900&1,400\\
|
129
|
+
\textbf{0020}&2006-08-09-1-D&2006-08-07&P&4.5900&1,100\\
|
130
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&16,000\\
|
131
|
+
\textbf{0022}&2006-08-21-1-I&2006-08-08&S&4.7000&16,000\\
|
132
|
+
\textbf{0023}&2006-08-21-1-D&2006-08-15&P&4.8000&16,000\\
|
133
|
+
\textbf{0024}&2006-08-21-1-I&2006-08-15&S&4.8000&16,000\\
|
134
|
+
\textbf{0025}&2006-08-21-1-I&2006-08-16&P&5.2900&2,100\\
|
135
|
+
\textbf{0026}&2006-08-21-1-I&2006-08-17&P&5.7000&2,900\\
|
136
|
+
\textbf{0027}&2006-08-25-1-D&2006-08-23&P&5.2400&8,000\\
|
137
|
+
\textbf{0028}&2006-08-29-1-I&2006-08-23&S&5.2400&8,000\\
|
138
|
+
\textbf{0029}&2006-08-29-1-D&2006-08-28&P&5.4000&1,000\\
|
139
|
+
\textbf{0030}&2006-08-30-1-D&2006-08-29&P&5.4000&2,000\\
|
140
|
+
\textbf{0031}&2006-08-30-1-I&2006-08-29&S&5.4000&2,000\\
|
141
|
+
\textbf{0032}&2006-09-06-1-I&2006-09-05&P&5.7500&2,700\\
|
142
|
+
\textbf{0033}&2006-09-15-1-D&2006-09-11&P&5.7200&4,000\\
|
143
|
+
\textbf{0034}&2006-09-15-1-I&2006-09-11&S&5.7200&4,000\\
|
144
|
+
\textbf{0035}&2006-09-15-2-I&2006-09-12&P&5.4800&3,000\\
|
145
|
+
\textbf{0036}&2006-09-15-2-I&2006-09-13&P&5.4100&1,700\\
|
146
|
+
\textbf{0037}&2006-09-21-1-I&2006-09-20&P&5.4900&7,500\\
|
147
|
+
\textbf{0038}&2006-12-11-1-I&2006-12-07&S&7.8900&6,000\\
|
148
|
+
\textbf{0039}&2006-12-11-1-I&2006-12-11&S&8.0000&100\\
|
149
|
+
\textbf{0040}&2007-04-27-1-I&2007-01-29&P&12.1000&2,500\\
|
150
|
+
\textbf{0041}&2007-04-27-1-I&2007-01-31&P&13.7000&2,500\\
|
151
|
+
\textbf{0042}&2007-04-27-1-I&2007-02-02&P&15.1500&4,000\\
|
152
|
+
\textbf{0043}&2007-04-27-1-I&2007-02-06&P&14.9500&5,000\\
|
153
|
+
\textbf{0044}&2007-04-27-1-I&2007-02-07&P&15.0000&400\\
|
154
|
+
\textbf{0045}&2007-04-27-1-I&2007-02-08&P&15.0000&4,600\\
|
155
|
+
\textbf{0046}&2007-04-27-1-I&2007-02-12&P&14.9100&3,500\\
|
156
|
+
\textbf{0047}&2007-04-27-1-D&2007-02-13&P&14.6500&1,500\\
|
157
|
+
\textbf{0048}&2007-04-27-1-D&2007-02-14&P&14.4900&2,000\\
|
158
|
+
\textbf{0049}&2007-04-27-1-I&2007-02-15&P&14.3000&3,000\\
|
159
|
+
\textbf{0050}&2007-04-27-1-D&2007-02-21&P&14.6500&8,500\\
|
160
|
+
\textbf{0051}&2007-04-27-1-I&2007-02-21&S&14.6500&8,500\\
|
161
|
+
\textbf{0052}&2007-04-27-1-I&2007-02-22&P&14.8800&1,500\\
|
162
|
+
\textbf{0053}&2007-04-27-1-I&2007-02-23&P&14.9700&3,000\\
|
163
|
+
\textbf{0054}&2007-04-27-1-I&2007-02-23&P&14.9700&5,000\\
|
164
|
+
\textbf{0055}&2007-04-27-1-I&2007-02-27&P&13.8800&5,200\\
|
165
|
+
\textbf{0056}&2007-04-27-1-D&2007-02-28&P&13.0000&6,700\\
|
166
|
+
\textbf{0057}&2007-04-27-1-I&2007-02-28&P&13.0000&800\\
|
167
|
+
\textbf{0058}&2007-04-27-1-I&2007-02-28&P&13.0000&8,400\\
|
168
|
+
\textbf{0059}&2007-04-27-1-D&2007-03-01&P&12.2500&2,500\\
|
169
|
+
\textbf{0060}&2007-04-27-1-D&2007-03-05&P&11.9700&1,800\\
|
170
|
+
\textbf{0061}&2007-04-27-1-D&2007-03-06&P&12.1300&500\\
|
171
|
+
\textbf{0062}&2007-04-27-1-D&2007-03-07&P&12.3700&3,000\\
|
172
|
+
\textbf{0063}&2007-04-27-1-I&2007-03-08&P&12.6000&2,000\\
|
173
|
+
\textbf{0064}&2007-04-27-1-I&2007-03-09&P&12.8100&7,700\\
|
174
|
+
\textbf{0065}&2007-04-27-1-I&2007-03-12&P&12.4600&4,200\\
|
175
|
+
\textbf{0066}&2007-04-27-1-I&2007-03-13&P&12.2500&800\\
|
176
|
+
\textbf{0067}&2007-04-27-2-I&2007-03-19&P&14.5500&2,000\\
|
177
|
+
\textbf{0068}&2007-04-27-2-I&2007-03-19&P&14.5500&5,000\\
|
178
|
+
\textbf{0069}&2007-04-27-2-I&2007-03-19&P&14.3300&2,000\\
|
179
|
+
\textbf{0070}&2007-04-27-2-I&2007-03-20&P&14.4600&1,000\\
|
180
|
+
\textbf{0071}&2007-04-27-2-I&2007-03-20&P&14.4600&1,500\\
|
181
|
+
\textbf{0072}&2007-04-27-2-I&2007-03-21&P&16.9000&3,900\\
|
182
|
+
\textbf{0073}&2007-04-27-1-D&2007-03-23&P&14.9700&8,000\\
|
183
|
+
\textbf{0074}&2007-04-27-2-I&2007-03-27&P&16.9300&1,000\\
|
184
|
+
\textbf{0075}&2007-04-27-2-D&2007-03-28&P&16.5000&1,000\\
|
185
|
+
\textbf{0076}&2007-04-27-2-D&2007-03-29&P&16.2500&1,000\\
|
186
|
+
\textbf{0077}&2007-04-27-2-I&2007-04-04&P&17.8600&200\\
|
187
|
+
\textbf{0078}&2007-04-27-2-I&2007-04-04&P&19.5000&2,000\\
|
188
|
+
\textbf{0079}&2007-04-27-2-I&2007-04-04&P&19.1300&3,000\\
|
189
|
+
\textbf{0080}&2007-04-27-2-I&2007-04-05&P&19.1500&1,000\\
|
190
|
+
\textbf{0081}&2007-04-27-2-I&2007-04-10&P&20.7500&2,000\\
|
191
|
+
\textbf{0082}&2007-04-27-2-I&2007-04-11&P&20.5000&1,000\\
|
192
|
+
\textbf{0083}&2007-04-27-2-I&2007-04-12&P&21.5000&600\\
|
193
|
+
\textbf{0084}&2007-04-27-2-I&2007-04-12&P&21.4500&1,000\\
|
194
|
+
\textbf{0085}&2007-04-27-2-I&2007-04-13&P&21.5000&2,100\\
|
195
|
+
\textbf{0086}&2007-04-27-2-I&2007-04-16&P&22.6000&500\\
|
196
|
+
\textbf{0087}&2007-04-27-2-D&2007-04-17&P&23.5500&3,500\\
|
197
|
+
\textbf{0088}&2007-04-27-2-I&2007-04-17&S&23.5500&3,500\\
|
198
|
+
\textbf{0089}&2007-04-27-2-I&2007-04-23&P&23.4500&5,000\\
|
199
|
+
\textbf{0090}&2007-04-27-2-I&2007-04-24&P&24.3000&5,000\\
|
200
|
+
\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&10,000\\
|
201
|
+
\end{longtable}
|
202
|
+
}
|
203
|
+
\providecommand{\MatchTable}{}
|
204
|
+
\renewcommand{\MatchTable}{\begin{longtable}{llccrrllccrrr}
|
205
|
+
\hline\\[0.5ex]
|
206
|
+
\multicolumn{6}{c}{\textbf{Purchases}}&
|
207
|
+
\multicolumn{6}{c}{\textbf{Sales}}\\
|
208
|
+
\textbf{Ref}&\textbf{Info}&\textbf{Date}&\textbf{Code}&\textbf{Price}&\textbf{Shares}
|
209
|
+
&\textbf{Ref}&\textbf{Info}&\textbf{Date}&\textbf{Code}&\textbf{Price}&\textbf{Shares}
|
210
|
+
&\textbf{Profit}\\
|
211
|
+
\hline\\[0.5ex]
|
212
|
+
\endhead
|
213
|
+
&\\
|
214
|
+
\multicolumn{3}{l}{\qquad\textbf{Totals:}}&&&\textbf{42,100.}&&&&&&\textbf{42,100.}&\textbf{\$283,695.00}\\
|
215
|
+
\endlastfoot
|
216
|
+
\textbf{0060}&2007-04-27-1-D&2007-03-05&P&11.9700&1,800&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&1,800&\textbf{24,714.00}\\
|
217
|
+
\textbf{0040}&2007-04-27-1-I&2007-01-29&P&12.1000&2,500&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&2,500&\textbf{34,000.00}\\
|
218
|
+
\textbf{0061}&2007-04-27-1-D&2007-03-06&P&12.1300&500&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&500&\textbf{6,785.00}\\
|
219
|
+
\textbf{0066}&2007-04-27-1-I&2007-03-13&P&12.2500&800&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&800&\textbf{10,760.00}\\
|
220
|
+
\textbf{0059}&2007-04-27-1-D&2007-03-01&P&12.2500&2,500&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&2,500&\textbf{33,625.00}\\
|
221
|
+
\textbf{0062}&2007-04-27-1-D&2007-03-07&P&12.3700&1,900&\textbf{0091}&2007-04-27-2-I&2007-04-25&S&25.7000&1,900&\textbf{25,327.00}\\
|
222
|
+
\textbf{0062}&2007-04-27-1-D&2007-03-07&P&12.3700&1,100&\textbf{0088}&2007-04-27-2-I&2007-04-17&S&23.5500&1,100&\textbf{12,298.00}\\
|
223
|
+
\textbf{0065}&2007-04-27-1-I&2007-03-12&P&12.4600&2,400&\textbf{0088}&2007-04-27-2-I&2007-04-17&S&23.5500&2,400&\textbf{26,616.00}\\
|
224
|
+
\textbf{0027}&2006-08-25-1-D&2006-08-23&P&5.2400&8,000&\textbf{0051}&2007-04-27-1-I&2007-02-21&S&14.6500&8,000&\textbf{75,280.00}\\
|
225
|
+
\textbf{0029}&2006-08-29-1-D&2006-08-28&P&5.4000&500&\textbf{0051}&2007-04-27-1-I&2007-02-21&S&14.6500&500&\textbf{4,625.00}\\
|
226
|
+
\textbf{0019}&2006-08-09-1-D&2006-08-03&P&4.3900&100&\textbf{0039}&2006-12-11-1-I&2006-12-11&S&8.0000&100&\textbf{361.00}\\
|
227
|
+
\textbf{0019}&2006-08-09-1-D&2006-08-03&P&4.3900&1,300&\textbf{0038}&2006-12-11-1-I&2006-12-07&S&7.8900&1,300&\textbf{4,550.00}\\
|
228
|
+
\textbf{0020}&2006-08-09-1-D&2006-08-07&P&4.5900&1,100&\textbf{0038}&2006-12-11-1-I&2006-12-07&S&7.8900&1,100&\textbf{3,630.00}\\
|
229
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&3,600&\textbf{0038}&2006-12-11-1-I&2006-12-07&S&7.8900&3,600&\textbf{11,484.00}\\
|
230
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&4,000&\textbf{0034}&2006-09-15-1-I&2006-09-11&S&5.7200&4,000&\textbf{4,080.00}\\
|
231
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&2,000&\textbf{0031}&2006-08-30-1-I&2006-08-29&S&5.4000&2,000&\textbf{1,400.00}\\
|
232
|
+
\textbf{0021}&2006-08-21-1-D&2006-08-08&P&4.7000&6,400&\textbf{0028}&2006-08-29-1-I&2006-08-23&S&5.2400&6,400&\textbf{3,456.00}\\
|
233
|
+
\textbf{0023}&2006-08-21-1-D&2006-08-15&P&4.8000&1,600&\textbf{0028}&2006-08-29-1-I&2006-08-23&S&5.2400&1,600&\textbf{704.00}\\
|
234
|
+
\end{longtable}
|
235
|
+
}
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class Test::Unit::TestCase
|
6
|
+
# Transactional fixtures accelerate your tests by wrapping each test method
|
7
|
+
# in a transaction that's rolled back on completion. This ensures that the
|
8
|
+
# test database remains unchanged so your fixtures don't have to be reloaded
|
9
|
+
# between every test method. Fewer database queries means faster tests.
|
10
|
+
#
|
11
|
+
# Read Mike Clark's excellent walkthrough at
|
12
|
+
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
13
|
+
#
|
14
|
+
# Every Active Record database supports transactions except MyISAM tables
|
15
|
+
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
16
|
+
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
17
|
+
# is recommended.
|
18
|
+
#
|
19
|
+
# The only drawback to using transactional fixtures is when you actually
|
20
|
+
# need to test transactions. Since your test is bracketed by a transaction,
|
21
|
+
# any transactions started in your code will be automatically rolled back.
|
22
|
+
self.use_transactional_fixtures = true
|
23
|
+
|
24
|
+
# Instantiated fixtures are slow, but give you @david where otherwise you
|
25
|
+
# would need people(:david). If you don't want to migrate your existing
|
26
|
+
# test cases which use the @david style and don't mind the speed hit (each
|
27
|
+
# instantiated fixtures translates to a database query per test method),
|
28
|
+
# then set this back to true.
|
29
|
+
self.use_instantiated_fixtures = false
|
30
|
+
|
31
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
32
|
+
#
|
33
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
|
+
# -- they do not yet inherit this setting
|
35
|
+
fixtures :all
|
36
|
+
|
37
|
+
# Add more helper methods to be used by all tests here...
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: calc_profit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel E. Doherty
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fat_core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-doc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: wirble
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email: ded-law@ddoherty.net
|
127
|
+
executables:
|
128
|
+
- calc_profit
|
129
|
+
- do-demo.sh
|
130
|
+
- easters.rb
|
131
|
+
- tm-profit.rb
|
132
|
+
extensions: []
|
133
|
+
extra_rdoc_files:
|
134
|
+
- README.rdoc
|
135
|
+
files:
|
136
|
+
- ".gitignore"
|
137
|
+
- ".rspec"
|
138
|
+
- Gemfile
|
139
|
+
- Install
|
140
|
+
- README.rdoc
|
141
|
+
- Rakefile
|
142
|
+
- bin/calc_profit
|
143
|
+
- bin/do-demo.sh
|
144
|
+
- bin/easters.rb
|
145
|
+
- bin/tm-profit.rb
|
146
|
+
- calc_profit.gemspec
|
147
|
+
- examples/Trans.csv
|
148
|
+
- examples/driver.tex
|
149
|
+
- examples/lopez.csv
|
150
|
+
- examples/profit.lp
|
151
|
+
- examples/solution.out
|
152
|
+
- lib/calc_profit.rb
|
153
|
+
- lib/calc_profit/core_ext.rb
|
154
|
+
- lib/calc_profit/core_ext/array.rb
|
155
|
+
- lib/calc_profit/core_ext/string.rb
|
156
|
+
- lib/calc_profit/latex_table_builder.rb
|
157
|
+
- lib/calc_profit/match.rb
|
158
|
+
- lib/calc_profit/table.rb
|
159
|
+
- lib/calc_profit/transaction.rb
|
160
|
+
- lib/calc_profit/transaction_group.rb
|
161
|
+
- lib/calc_profit/version.rb
|
162
|
+
- test/TestAddress.rb
|
163
|
+
- test/TestDBase.rb
|
164
|
+
- test/TestDate.rb
|
165
|
+
- test/TestLog.rb
|
166
|
+
- test/TestName.rb
|
167
|
+
- test/TestRetriever.rb
|
168
|
+
- test/TestString.rb
|
169
|
+
- test/TestTeXString.rb
|
170
|
+
- test/TestTransaction.rb
|
171
|
+
- test/Trans.csv
|
172
|
+
- test/tabdemo-tm.tex
|
173
|
+
- test/tabdemo.tex
|
174
|
+
- test/tables-tm.tex
|
175
|
+
- test/tables.tex
|
176
|
+
- test/test_helper.rb
|
177
|
+
homepage:
|
178
|
+
licenses:
|
179
|
+
- MIT
|
180
|
+
metadata: {}
|
181
|
+
post_install_message:
|
182
|
+
rdoc_options:
|
183
|
+
- "--title"
|
184
|
+
- byr
|
185
|
+
- "--main"
|
186
|
+
- README.rdoc
|
187
|
+
- "-ri"
|
188
|
+
require_paths:
|
189
|
+
- lib
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
requirements: []
|
201
|
+
rubyforge_project:
|
202
|
+
rubygems_version: 2.2.2
|
203
|
+
signing_key:
|
204
|
+
specification_version: 4
|
205
|
+
summary: Library for calculation od Section 16 short-swing profits
|
206
|
+
test_files:
|
207
|
+
- test/TestAddress.rb
|
208
|
+
- test/TestDBase.rb
|
209
|
+
- test/TestDate.rb
|
210
|
+
- test/TestLog.rb
|
211
|
+
- test/TestName.rb
|
212
|
+
- test/TestRetriever.rb
|
213
|
+
- test/TestString.rb
|
214
|
+
- test/TestTeXString.rb
|
215
|
+
- test/TestTransaction.rb
|
216
|
+
- test/Trans.csv
|
217
|
+
- test/tabdemo-tm.tex
|
218
|
+
- test/tabdemo.tex
|
219
|
+
- test/tables-tm.tex
|
220
|
+
- test/tables.tex
|
221
|
+
- test/test_helper.rb
|
222
|
+
has_rdoc: true
|