Skip to content

Commit feee888

Browse files
committed
update notebooks
1 parent 863bf66 commit feee888

File tree

2 files changed

+619
-45
lines changed

2 files changed

+619
-45
lines changed

notebooks/code_samples/capital_markets/quickstart_option_pricing_models.ipynb

Lines changed: 603 additions & 28 deletions
Large diffs are not rendered by default.

notebooks/code_samples/capital_markets/quickstart_option_pricing_models_quantlib.ipynb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
},
264264
{
265265
"cell_type": "code",
266-
"execution_count": 1,
266+
"execution_count": 4,
267267
"id": "86a8da01",
268268
"metadata": {},
269269
"outputs": [],
@@ -324,7 +324,7 @@
324324
},
325325
{
326326
"cell_type": "code",
327-
"execution_count": 21,
327+
"execution_count": 6,
328328
"id": "b27d7fc3",
329329
"metadata": {},
330330
"outputs": [],
@@ -374,7 +374,7 @@
374374
},
375375
{
376376
"cell_type": "code",
377-
"execution_count": 22,
377+
"execution_count": 7,
378378
"id": "f29f07ef",
379379
"metadata": {},
380380
"outputs": [],
@@ -417,13 +417,13 @@
417417
},
418418
{
419419
"cell_type": "code",
420-
"execution_count": 23,
420+
"execution_count": 8,
421421
"id": "0e129f19",
422422
"metadata": {},
423423
"outputs": [],
424424
"source": [
425425
"ticker = \"MSFT\"\n",
426-
"expiration_date = \"2024-11-15\" # Example expiration date in 'YYYY-MM-DD' form\n",
426+
"expiration_date = \"2024-12-06\" # Example expiration date in 'YYYY-MM-DD' form\n",
427427
"\n",
428428
"market_data = get_market_data(ticker=ticker, expiration_date_str=expiration_date)"
429429
]
@@ -440,7 +440,7 @@
440440
},
441441
{
442442
"cell_type": "code",
443-
"execution_count": 24,
443+
"execution_count": 9,
444444
"id": "d28df598",
445445
"metadata": {},
446446
"outputs": [],
@@ -459,7 +459,7 @@
459459
},
460460
{
461461
"cell_type": "code",
462-
"execution_count": 25,
462+
"execution_count": 10,
463463
"id": "dc070da8",
464464
"metadata": {},
465465
"outputs": [],
@@ -589,7 +589,7 @@
589589
"metadata": {},
590590
"outputs": [],
591591
"source": [
592-
"calculation_date = ql.Date(4, 11, 2024)\n",
592+
"calculation_date = ql.Date(26, 11, 2024)\n",
593593
"# Convert expiration date string to QuantLib.Date\n",
594594
"expiry_date_parts = list(map(int, expiration_date.split('-')))\n",
595595
"maturity_date = ql.Date(expiry_date_parts[2], expiry_date_parts[1], expiry_date_parts[0])\n",
@@ -637,7 +637,7 @@
637637
},
638638
{
639639
"cell_type": "code",
640-
"execution_count": 27,
640+
"execution_count": 12,
641641
"id": "810cf887",
642642
"metadata": {},
643643
"outputs": [],
@@ -686,7 +686,6 @@
686686
"\n",
687687
" }\n",
688688
" df1 = pd.DataFrame(data)\n",
689-
"\n",
690689
" return {\"strikes variation benchmarking\": df1}"
691690
]
692691
},
@@ -725,7 +724,7 @@
725724
},
726725
{
727726
"cell_type": "code",
728-
"execution_count": 29,
727+
"execution_count": 14,
729728
"id": "80492c82",
730729
"metadata": {},
731730
"outputs": [],
@@ -784,7 +783,7 @@
784783
},
785784
{
786785
"cell_type": "code",
787-
"execution_count": 30,
786+
"execution_count": 15,
788787
"id": "4862005d",
789788
"metadata": {},
790789
"outputs": [],
@@ -811,7 +810,7 @@
811810
},
812811
{
813812
"cell_type": "code",
814-
"execution_count": 31,
813+
"execution_count": 16,
815814
"id": "b2115371",
816815
"metadata": {},
817816
"outputs": [],
@@ -854,10 +853,10 @@
854853
"result.log()\n",
855854
"# Visualize how option prices change with different strike prices\n",
856855
"plot_results(\n",
857-
" pd.DataFrame(result.metric.summary.results[0].data),\n",
856+
" pd.DataFrame(result.tables[0].data),\n",
858857
" params={\n",
859858
" \"x\": \"strike_price\",\n",
860-
" \"y\":\"value\",\n",
859+
" \"y\":\"Value\",\n",
861860
" \"label\":\"Strike price\",\n",
862861
" \"xlabel\":\"Strike price\",\n",
863862
" \"ylabel\":\"option price\",\n",
@@ -878,7 +877,7 @@
878877
},
879878
{
880879
"cell_type": "code",
881-
"execution_count": 33,
880+
"execution_count": 18,
882881
"id": "b977f2e3",
883882
"metadata": {},
884883
"outputs": [],
@@ -1151,7 +1150,7 @@
11511150
"name": "python",
11521151
"nbconvert_exporter": "python",
11531152
"pygments_lexer": "ipython3",
1154-
"version": "3.11.5"
1153+
"version": "3.10.14"
11551154
}
11561155
},
11571156
"nbformat": 4,

0 commit comments

Comments
 (0)