Skip to content

Commit c4bc9b5

Browse files
committed
Update examples
1 parent a99ff8d commit c4bc9b5

11 files changed

+190
-431
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.pytest_cache
33
__pycache__
44
dist
5-
run_check
5+
run_check
6+
*.old

examples/black_scholes_calculator.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"output_type": "stream",
4444
"text": [
4545
"Python version: 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)]\n",
46-
"OptionLab version: 1.3.4\n"
46+
"OptionLab version: 1.4.1\n"
4747
]
4848
}
4949
],
@@ -106,7 +106,7 @@
106106
"output_type": "stream",
107107
"text": [
108108
"CPU times: total: 0 ns\n",
109-
"Wall time: 4.36 ms\n"
109+
"Wall time: 5.82 ms\n"
110110
]
111111
}
112112
],

examples/calendar_spread.ipynb

Lines changed: 21 additions & 34 deletions
Large diffs are not rendered by default.

examples/call_spread.ipynb

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@
164164
"name": "stdout",
165165
"output_type": "stream",
166166
"text": [
167-
"CPU times: total: 19.6 s\n",
168-
"Wall time: 20.7 s\n"
167+
"CPU times: total: 32.3 s\n",
168+
"Wall time: 33.7 s\n"
169169
]
170170
}
171171
],
@@ -240,7 +240,9 @@
240240
"Maximum profit: 5.00\n",
241241
"Profitable stock price range:\n",
242242
" 304.96 ---> inf\n",
243-
"Probability of Profit (PoP): 99.1\n"
243+
"Probability of Profit (PoP): 99.1\n",
244+
"Expected profit: 5.00\n",
245+
"Expected loss: -503.00\n"
244246
]
245247
}
246248
],
@@ -253,7 +255,9 @@
253255
"for low, high in out.profit_ranges:\n",
254256
" print(f\" {low:.2f} ---> {high:.2f}\")\n",
255257
"\n",
256-
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")"
258+
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")\n",
259+
"print(f\"Expected profit: {out.expected_profit:.2f}\")\n",
260+
"print(f\"Expected loss: {out.expected_loss:.2f}\")"
257261
]
258262
},
259263
{
@@ -269,7 +273,7 @@
269273
{
270274
"data": {
271275
"text/plain": [
272-
"[<matplotlib.lines.Line2D at 0x1c8fff7ccd0>]"
276+
"[<matplotlib.lines.Line2D at 0x1f26fc97490>]"
273277
]
274278
},
275279
"execution_count": 9,
@@ -383,8 +387,8 @@
383387
"name": "stdout",
384388
"output_type": "stream",
385389
"text": [
386-
"CPU times: total: 18.9 s\n",
387-
"Wall time: 20.4 s\n"
390+
"CPU times: total: 30.1 s\n",
391+
"Wall time: 31 s\n"
388392
]
389393
}
390394
],
@@ -459,7 +463,9 @@
459463
"Maximum profit: 8707.00\n",
460464
"Profitable stock price range:\n",
461465
" 342.94 ---> inf\n",
462-
"Probability of Profit (PoP): 49.1\n"
466+
"Probability of Profit (PoP): 49.1\n",
467+
"Expected profit: 1367.00\n",
468+
"Expected loss: -1338.00\n"
463469
]
464470
}
465471
],
@@ -472,7 +478,9 @@
472478
"for low, high in out.profit_ranges:\n",
473479
" print(f\" {low:.2f} ---> {high:.2f}\")\n",
474480
"\n",
475-
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")"
481+
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")\n",
482+
"print(f\"Expected profit: {out.expected_profit:.2f}\")\n",
483+
"print(f\"Expected loss: {out.expected_loss:.2f}\")"
476484
]
477485
},
478486
{
@@ -488,7 +496,7 @@
488496
{
489497
"data": {
490498
"text/plain": [
491-
"[<matplotlib.lines.Line2D at 0x1c8996863d0>]"
499+
"[<matplotlib.lines.Line2D at 0x1f272e5ed50>]"
492500
]
493501
},
494502
"execution_count": 15,

examples/covered_call.ipynb

Lines changed: 24 additions & 36 deletions
Large diffs are not rendered by default.

examples/naked_call.ipynb

Lines changed: 17 additions & 27 deletions
Large diffs are not rendered by default.

examples/pop_calculator.ipynb

Lines changed: 0 additions & 210 deletions
This file was deleted.

0 commit comments

Comments
 (0)