This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| # In[60]: | |
| import pandas as pd | |
| import statsmodels.api as sm | |
| from statsmodels.stats.outliers_influence import variance_inflation_factor | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding: utf-8 -*- | |
| # python3 | |
| from __future__ import division | |
| import sys | |
| import numpy as np | |
| import xlwings as xw | |
| from datetime import datetime | |
| import math |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Refresh() | |
| Application.Calculation = xlManual | |
| Dim Today As Date | |
| Dim i As Long | |
| Today = Sheets("Market Info.").Cells(3, 1) | |
| If Cells(5, 3) = Today Then | |
| If IsError(Sheets("Market Info.").Cells(6, 3)) Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Prepare() | |
| Application.Calculation = xlManual | |
| Dim AsofDate As Date | |
| Dim i As Long | |
| AsofDate = Cells(5, 3) | |
| Refresh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Prepare() | |
| Application.Calculation = xlManual | |
| Dim AsofDate As Date | |
| Dim i As Long | |
| AsofDate = Cells(5, 3) | |
| Refresh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Prepare() | |
| Application.Calculation = xlManual | |
| Dim AsofDate As Date | |
| Dim i As Long | |
| AsofDate = Cells(5, 3) | |
| Refresh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Prepare() | |
| Application.Calculation = xlManual | |
| Dim AsofDate As Date | |
| Dim i As Long | |
| AsofDate = Cells(5, 3) | |
| Refresh | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Public Function BarrierValue(CallPutFlag As String, DownUpFlag As String, InOutFlag As String, S As Double, X As Double, H As Double, K As Double, _ | |
| T As Double, r As Double, q As Double, v As Double, Hit As String) As Double | |
| Dim mu As Double | |
| Dim lambda As Double | |
| Dim X1 As Double, X2 As Double | |
| Dim y1 As Double, y2 As Double | |
| Dim z As Double |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Public Function DigitalValue(CallPutFlag As String, S As Double, X As Double, K As Double, T As Double, _ | |
| r As Double, q As Double, v As Double) As Double | |
| Dim d As Double | |
| If T <= 0 Then | |
| If CallPutFlag = "C" Then | |
| If (S >= X) Then | |
| DigitalValue = K |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Public Function CND(z As Double) As Double | |
| CND = Application.NormSDist(z) | |
| End Function | |