Skip to content

Commit

Permalink
Fixed GBM Process code
Browse files Browse the repository at this point in the history
  • Loading branch information
domokane committed Sep 30, 2024
1 parent 66fdf2d commit d54f9a2
Show file tree
Hide file tree
Showing 183 changed files with 90,727 additions and 543 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

# PYTHON AND JUPYTER FILES
build/
*.png
*.jpeg
env/
.venv/
develop-eggs/
Expand Down Expand Up @@ -130,5 +132,5 @@ fabric.properties

#MacOS Files
.DS_Store
docs/FinancePyManual.fls
*.dvi
docs/FinancePyManual.fls
*.dvi
9 changes: 9 additions & 0 deletions book/ALL FINANCEPY/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Using FinancePy in a Jupyter Notebook

Once financepy has been installed, it is easy to get started.

Just download the project and examine the set of Jupyter Notebooks in this notebooks folder.

These have been organised according to the same directory structure as the project.

A pdf manual describing all of the functions can be found in the project directory.
1 change: 1 addition & 0 deletions book/ALL FINANCEPY/cleanErrors.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
del /S ERROR_*.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# USING CALENDARS"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"from financepy.utils import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see what calendars are available"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CalendarTypes.NONE\n",
"CalendarTypes.WEEKEND\n",
"CalendarTypes.AUSTRALIA\n",
"CalendarTypes.CANADA\n",
"CalendarTypes.FRANCE\n",
"CalendarTypes.GERMANY\n",
"CalendarTypes.ITALY\n",
"CalendarTypes.JAPAN\n",
"CalendarTypes.NEW_ZEALAND\n",
"CalendarTypes.NORWAY\n",
"CalendarTypes.SWEDEN\n",
"CalendarTypes.SWITZERLAND\n",
"CalendarTypes.TARGET\n",
"CalendarTypes.UNITED_STATES\n",
"CalendarTypes.UNITED_KINGDOM\n"
]
}
],
"source": [
"for e in CalendarTypes:\n",
" print(e)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Holiday Lists"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# Specify US holiday calendar\n",
"calUS = Calendar(CalendarTypes.UNITED_STATES)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/plain": [
"['01-JAN-2019',\n",
" '21-JAN-2019',\n",
" '18-FEB-2019',\n",
" '27-MAY-2019',\n",
" '04-JUL-2019',\n",
" '02-SEP-2019',\n",
" '14-OCT-2019',\n",
" '11-NOV-2019',\n",
" '28-NOV-2019',\n",
" '25-DEC-2019']"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"calUS.get_holiday_list(2019)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# Specify UK holiday calendar\n",
"calUK = Calendar(CalendarTypes.UNITED_KINGDOM)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['01-JAN-2019',\n",
" '19-APR-2019',\n",
" '22-APR-2019',\n",
" '06-MAY-2019',\n",
" '27-MAY-2019',\n",
" '26-AUG-2019',\n",
" '25-DEC-2019',\n",
" '26-DEC-2019']"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"calUK.get_holiday_list(2019)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# Specify EUROPEAN TARGET holiday calendar\n",
"calEU = Calendar(CalendarTypes.TARGET)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['01-JAN-2019',\n",
" '19-APR-2019',\n",
" '22-APR-2019',\n",
" '01-MAY-2019',\n",
" '25-DEC-2019',\n",
" '26-DEC-2019']"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"calEU.get_holiday_list(2019)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Easter Monday"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"22-APR-2019\n"
]
}
],
"source": [
"print(calEU.easter_monday(2019))"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"02-APR-2018\n"
]
}
],
"source": [
"print(calEU.easter_monday(2018))"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"17-APR-2017\n"
]
}
],
"source": [
"print(calEU.easter_monday(2017))"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"28-MAR-2016\n"
]
}
],
"source": [
"print(calEU.easter_monday(2016))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Copyright (c) 2020 Dominic O'Kane"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.13"
},
"vscode": {
"interpreter": {
"hash": "bf723d6cfadaef99605cbe395b066743a854874e8c7ea88f8e08ad90fcfaf87e"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit d54f9a2

Please sign in to comment.