Skip to content

Commit

Permalink
Chore: Make release 1.0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
martinroberson authored and Vanden Bon, David V [GBM Public] committed Sep 20, 2023
1 parent 115a06b commit 1b82ff4
Show file tree
Hide file tree
Showing 3 changed files with 511 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true
}
},
"outputs": [],
"source": [
"from gs_quant.instrument import FXVarianceSwap"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from gs_quant.session import GsSession\n",
"# external users should substitute their client id and secret; please skip this step if using internal jupyterhub\n",
"GsSession.use(client_id=None, client_secret=None, scopes=('run_analytics'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# get list of properties of an fx var swap\n",
"FXVarianceSwap.properties()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"swap = FXVarianceSwap(pair='GBPUSD', last_fixing_date='3m', buy_sell='Buy')\n",
"swap.resolve()\n",
"print(swap.strike_vol*100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pprint \n",
"pp = pprint.PrettyPrinter(indent=4)\n",
"\n",
"#forward starting var swap\n",
"fwd_6m6m_swap = FXVarianceSwap(pair='USDJPY', first_fixing_date='6m', last_fixing_date='1y', buy_sell='Buy')\n",
"fwd_6m6m_swap.resolve()\n",
"pp.pprint(fwd_6m6m_swap.as_dict())"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"**Fixing frequency** defaults to 'Daily/Business Days' but many other conventions are supported such as:\n",
"* 'Daily/All Days'\n",
"* 'Daily/Holiday'\n",
"* 'Daily/MonToSat'\n",
"* 'Daily/Weighted Lagging'\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"weighted_swap = FXVarianceSwap(pair='GBPUSD', last_fixing_date='1y', buy_sell='Buy', fixing_frequency='Daily/Weighted Lagging')\n",
"weighted_swap.resolve()\n",
"pp.pprint(weighted_swap.as_dict())"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"**Fixing source** defaults to 'WM Company LDN 4pm Mid' but other options include:\n",
"* 'GS NYC 3PM'\n",
"* 'WM Company NYC 10am Mid'\n",
"* 'BFIX LDN 4PM'\n",
"* 'WMC Company LDN 1pm Mid'\n",
"\n",
"We also have bloomberg options as well such as 'BFIX TKO 3pm-m'. \n",
"We're happy to confirm the syntax if you are looking for a fixing source that is not mentioned here.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bfix = FXVarianceSwap(pair='GBPUSD', last_fixing_date='1y', buy_sell='Buy', fixing_source='BFIX LDN 4PM')\n",
"bfix.resolve()\n",
"print(bfix.strike_vol)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 1b82ff4

Please sign in to comment.