option_lab 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +139 -0
- data/.yard/hooks/before_generate.rb +7 -0
- data/.yardopts +11 -0
- data/Gemfile +26 -0
- data/LICENSE.txt +21 -0
- data/README.md +180 -0
- data/Rakefile +44 -0
- data/docs/OptionLab/BinomialTree.html +1271 -0
- data/docs/OptionLab/BjerksundStensland.html +2022 -0
- data/docs/OptionLab/BlackScholes.html +2388 -0
- data/docs/OptionLab/Engine.html +1716 -0
- data/docs/OptionLab/Models/AmericanModelInputs.html +937 -0
- data/docs/OptionLab/Models/ArrayInputs.html +463 -0
- data/docs/OptionLab/Models/BaseModel.html +223 -0
- data/docs/OptionLab/Models/BinomialModelInputs.html +1161 -0
- data/docs/OptionLab/Models/BlackScholesInfo.html +967 -0
- data/docs/OptionLab/Models/BlackScholesModelInputs.html +851 -0
- data/docs/OptionLab/Models/ClosedPosition.html +445 -0
- data/docs/OptionLab/Models/EngineData.html +2523 -0
- data/docs/OptionLab/Models/EngineDataResults.html +435 -0
- data/docs/OptionLab/Models/Inputs.html +2241 -0
- data/docs/OptionLab/Models/LaplaceInputs.html +777 -0
- data/docs/OptionLab/Models/Option.html +736 -0
- data/docs/OptionLab/Models/Outputs.html +1753 -0
- data/docs/OptionLab/Models/PoPOutputs.html +645 -0
- data/docs/OptionLab/Models/PricingResult.html +848 -0
- data/docs/OptionLab/Models/Stock.html +583 -0
- data/docs/OptionLab/Models/TreeVisualization.html +688 -0
- data/docs/OptionLab/Models.html +251 -0
- data/docs/OptionLab/Plotting.html +548 -0
- data/docs/OptionLab/Support.html +2884 -0
- data/docs/OptionLab/Utils.html +619 -0
- data/docs/OptionLab.html +133 -0
- data/docs/_index.html +376 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.LICENSE.html +70 -0
- data/docs/file.README.html +263 -0
- data/docs/file_list.html +64 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +263 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1974 -0
- data/docs/top-level-namespace.html +110 -0
- data/examples/american_options.rb +163 -0
- data/examples/covered_call.rb +76 -0
- data/lib/option_lab/binomial_tree.rb +238 -0
- data/lib/option_lab/bjerksund_stensland.rb +276 -0
- data/lib/option_lab/black_scholes.rb +323 -0
- data/lib/option_lab/engine.rb +492 -0
- data/lib/option_lab/models.rb +768 -0
- data/lib/option_lab/plotting.rb +182 -0
- data/lib/option_lab/support.rb +471 -0
- data/lib/option_lab/utils.rb +107 -0
- data/lib/option_lab/version.rb +5 -0
- data/lib/option_lab.rb +134 -0
- data/option_lab.gemspec +43 -0
- metadata +207 -0
@@ -0,0 +1,435 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: OptionLab::Models::EngineDataResults
|
8
|
+
|
9
|
+
— OptionLab Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "OptionLab::Models::EngineDataResults";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../OptionLab.html" title="OptionLab (module)">OptionLab</a></span></span> » <span class='title'><span class='object_link'><a href="../Models.html" title="OptionLab::Models (module)">Models</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">EngineDataResults</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: OptionLab::Models::EngineDataResults
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="BaseModel.html" title="OptionLab::Models::BaseModel (class)">BaseModel</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="BaseModel.html" title="OptionLab::Models::BaseModel (class)">BaseModel</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">OptionLab::Models::EngineDataResults</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/option_lab/models.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
<p>Engine data results for access after calculations</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
119
|
+
<ul class="summary">
|
120
|
+
|
121
|
+
<li class="public ">
|
122
|
+
<span class="summary_signature">
|
123
|
+
|
124
|
+
<a href="#profit-instance_method" title="#profit (instance method)">#<strong>profit</strong> ⇒ Object </a>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</span>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute profit.</p>
|
142
|
+
</div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#stock_price_array-instance_method" title="#stock_price_array (instance method)">#<strong>stock_price_array</strong> ⇒ Object </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute stock_price_array.</p>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#strategy_profit-instance_method" title="#strategy_profit (instance method)">#<strong>strategy_profit</strong> ⇒ Object </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute strategy_profit.</p>
|
194
|
+
</div></span>
|
195
|
+
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
</ul>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<h2>
|
206
|
+
Instance Method Summary
|
207
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
208
|
+
</h2>
|
209
|
+
|
210
|
+
<ul class="summary">
|
211
|
+
|
212
|
+
<li class="public ">
|
213
|
+
<span class="summary_signature">
|
214
|
+
|
215
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(attributes = {}) ⇒ EngineDataResults </a>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
</span>
|
220
|
+
|
221
|
+
|
222
|
+
<span class="note title constructor">constructor</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of EngineDataResults.</p>
|
232
|
+
</div></span>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
|
237
|
+
</ul>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<div id="constructor_details" class="method_details_list">
|
243
|
+
<h2>Constructor Details</h2>
|
244
|
+
|
245
|
+
<div class="method_details first">
|
246
|
+
<h3 class="signature first" id="initialize-instance_method">
|
247
|
+
|
248
|
+
#<strong>initialize</strong>(attributes = {}) ⇒ <tt><span class='object_link'><a href="" title="OptionLab::Models::EngineDataResults (class)">EngineDataResults</a></span></tt>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</h3><div class="docstring">
|
255
|
+
<div class="discussion">
|
256
|
+
<p>Returns a new instance of EngineDataResults.</p>
|
257
|
+
|
258
|
+
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
<div class="tags">
|
262
|
+
|
263
|
+
|
264
|
+
</div><table class="source_code">
|
265
|
+
<tr>
|
266
|
+
<td>
|
267
|
+
<pre class="lines">
|
268
|
+
|
269
|
+
|
270
|
+
128
|
271
|
+
129
|
272
|
+
130
|
273
|
+
131
|
274
|
+
132
|
275
|
+
133</pre>
|
276
|
+
</td>
|
277
|
+
<td>
|
278
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 128</span>
|
279
|
+
|
280
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
281
|
+
<span class='ivar'>@stock_price_array</span> <span class='op'>=</span> <span class='const'>Numo</span><span class='op'>::</span><span class='const'>DFloat</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
282
|
+
<span class='ivar'>@strategy_profit</span> <span class='op'>=</span> <span class='const'>Numo</span><span class='op'>::</span><span class='const'>DFloat</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
283
|
+
<span class='ivar'>@profit</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
284
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
|
285
|
+
<span class='kw'>end</span></pre>
|
286
|
+
</td>
|
287
|
+
</tr>
|
288
|
+
</table>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div id="instance_attr_details" class="attr_details">
|
294
|
+
<h2>Instance Attribute Details</h2>
|
295
|
+
|
296
|
+
|
297
|
+
<span id="profit=-instance_method"></span>
|
298
|
+
<div class="method_details first">
|
299
|
+
<h3 class="signature first" id="profit-instance_method">
|
300
|
+
|
301
|
+
#<strong>profit</strong> ⇒ <tt>Object</tt>
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</h3><div class="docstring">
|
308
|
+
<div class="discussion">
|
309
|
+
<p>Returns the value of attribute profit.</p>
|
310
|
+
|
311
|
+
|
312
|
+
</div>
|
313
|
+
</div>
|
314
|
+
<div class="tags">
|
315
|
+
|
316
|
+
|
317
|
+
</div><table class="source_code">
|
318
|
+
<tr>
|
319
|
+
<td>
|
320
|
+
<pre class="lines">
|
321
|
+
|
322
|
+
|
323
|
+
126
|
324
|
+
127
|
325
|
+
128</pre>
|
326
|
+
</td>
|
327
|
+
<td>
|
328
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 126</span>
|
329
|
+
|
330
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_profit'>profit</span>
|
331
|
+
<span class='ivar'>@profit</span>
|
332
|
+
<span class='kw'>end</span></pre>
|
333
|
+
</td>
|
334
|
+
</tr>
|
335
|
+
</table>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
|
339
|
+
<span id="stock_price_array=-instance_method"></span>
|
340
|
+
<div class="method_details ">
|
341
|
+
<h3 class="signature " id="stock_price_array-instance_method">
|
342
|
+
|
343
|
+
#<strong>stock_price_array</strong> ⇒ <tt>Object</tt>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
</h3><div class="docstring">
|
350
|
+
<div class="discussion">
|
351
|
+
<p>Returns the value of attribute stock_price_array.</p>
|
352
|
+
|
353
|
+
|
354
|
+
</div>
|
355
|
+
</div>
|
356
|
+
<div class="tags">
|
357
|
+
|
358
|
+
|
359
|
+
</div><table class="source_code">
|
360
|
+
<tr>
|
361
|
+
<td>
|
362
|
+
<pre class="lines">
|
363
|
+
|
364
|
+
|
365
|
+
126
|
366
|
+
127
|
367
|
+
128</pre>
|
368
|
+
</td>
|
369
|
+
<td>
|
370
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 126</span>
|
371
|
+
|
372
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_stock_price_array'>stock_price_array</span>
|
373
|
+
<span class='ivar'>@stock_price_array</span>
|
374
|
+
<span class='kw'>end</span></pre>
|
375
|
+
</td>
|
376
|
+
</tr>
|
377
|
+
</table>
|
378
|
+
</div>
|
379
|
+
|
380
|
+
|
381
|
+
<span id="strategy_profit=-instance_method"></span>
|
382
|
+
<div class="method_details ">
|
383
|
+
<h3 class="signature " id="strategy_profit-instance_method">
|
384
|
+
|
385
|
+
#<strong>strategy_profit</strong> ⇒ <tt>Object</tt>
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
</h3><div class="docstring">
|
392
|
+
<div class="discussion">
|
393
|
+
<p>Returns the value of attribute strategy_profit.</p>
|
394
|
+
|
395
|
+
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
<div class="tags">
|
399
|
+
|
400
|
+
|
401
|
+
</div><table class="source_code">
|
402
|
+
<tr>
|
403
|
+
<td>
|
404
|
+
<pre class="lines">
|
405
|
+
|
406
|
+
|
407
|
+
126
|
408
|
+
127
|
409
|
+
128</pre>
|
410
|
+
</td>
|
411
|
+
<td>
|
412
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 126</span>
|
413
|
+
|
414
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_strategy_profit'>strategy_profit</span>
|
415
|
+
<span class='ivar'>@strategy_profit</span>
|
416
|
+
<span class='kw'>end</span></pre>
|
417
|
+
</td>
|
418
|
+
</tr>
|
419
|
+
</table>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</div>
|
423
|
+
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
<div id="footer">
|
428
|
+
Generated on Sun Apr 27 16:09:34 2025 by
|
429
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
430
|
+
0.9.37 (ruby-3.3.3).
|
431
|
+
</div>
|
432
|
+
|
433
|
+
</div>
|
434
|
+
</body>
|
435
|
+
</html>
|