Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaveiga committed Jan 15, 2025
1 parent a99ff8d commit c4bc9b5
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 431 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.pytest_cache
__pycache__
dist
run_check
run_check
*.old
4 changes: 2 additions & 2 deletions examples/black_scholes_calculator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"output_type": "stream",
"text": [
"Python version: 3.11.9 | packaged by Anaconda, Inc. | (main, Apr 19 2024, 16:40:41) [MSC v.1916 64 bit (AMD64)]\n",
"OptionLab version: 1.3.4\n"
"OptionLab version: 1.4.1\n"
]
}
],
Expand Down Expand Up @@ -106,7 +106,7 @@
"output_type": "stream",
"text": [
"CPU times: total: 0 ns\n",
"Wall time: 4.36 ms\n"
"Wall time: 5.82 ms\n"
]
}
],
Expand Down
55 changes: 21 additions & 34 deletions examples/calendar_spread.ipynb

Large diffs are not rendered by default.

28 changes: 18 additions & 10 deletions examples/call_spread.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: total: 19.6 s\n",
"Wall time: 20.7 s\n"
"CPU times: total: 32.3 s\n",
"Wall time: 33.7 s\n"
]
}
],
Expand Down Expand Up @@ -240,7 +240,9 @@
"Maximum profit: 5.00\n",
"Profitable stock price range:\n",
" 304.96 ---> inf\n",
"Probability of Profit (PoP): 99.1\n"
"Probability of Profit (PoP): 99.1\n",
"Expected profit: 5.00\n",
"Expected loss: -503.00\n"
]
}
],
Expand All @@ -253,7 +255,9 @@
"for low, high in out.profit_ranges:\n",
" print(f\" {low:.2f} ---> {high:.2f}\")\n",
"\n",
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")"
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")\n",
"print(f\"Expected profit: {out.expected_profit:.2f}\")\n",
"print(f\"Expected loss: {out.expected_loss:.2f}\")"
]
},
{
Expand All @@ -269,7 +273,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x1c8fff7ccd0>]"
"[<matplotlib.lines.Line2D at 0x1f26fc97490>]"
]
},
"execution_count": 9,
Expand Down Expand Up @@ -383,8 +387,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: total: 18.9 s\n",
"Wall time: 20.4 s\n"
"CPU times: total: 30.1 s\n",
"Wall time: 31 s\n"
]
}
],
Expand Down Expand Up @@ -459,7 +463,9 @@
"Maximum profit: 8707.00\n",
"Profitable stock price range:\n",
" 342.94 ---> inf\n",
"Probability of Profit (PoP): 49.1\n"
"Probability of Profit (PoP): 49.1\n",
"Expected profit: 1367.00\n",
"Expected loss: -1338.00\n"
]
}
],
Expand All @@ -472,7 +478,9 @@
"for low, high in out.profit_ranges:\n",
" print(f\" {low:.2f} ---> {high:.2f}\")\n",
"\n",
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")"
"print(f\"Probability of Profit (PoP): {out.probability_of_profit * 100.0:.1f}\")\n",
"print(f\"Expected profit: {out.expected_profit:.2f}\")\n",
"print(f\"Expected loss: {out.expected_loss:.2f}\")"
]
},
{
Expand All @@ -488,7 +496,7 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x1c8996863d0>]"
"[<matplotlib.lines.Line2D at 0x1f272e5ed50>]"
]
},
"execution_count": 15,
Expand Down
60 changes: 24 additions & 36 deletions examples/covered_call.ipynb

Large diffs are not rendered by default.

44 changes: 17 additions & 27 deletions examples/naked_call.ipynb

Large diffs are not rendered by default.

210 changes: 0 additions & 210 deletions examples/pop_calculator.ipynb

This file was deleted.

Loading

0 comments on commit c4bc9b5

Please sign in to comment.