<filename>test/ExternalData.py
import numpy as np
from scipy.stats import skew, kurtosis

'''
This data is used to test the price and greeks of a European call and
put option are valid

The price, delta ...Theta values have been generated externally via the
following website:
    https://www.math.drexel.edu/~pg/fin/VanillaCalculator.html

'''

# Fixed values for the test
EO_Strike = 50
EO_Vol = 0.2
EO_RiskFreeRate = 0.01
EO_TimeToMaturity = 1
EO_spot = [25, 45, 65]
# Values generated from external website
EO_callPrice = [0.0005702320, 1.9307066574, 15.9481600990]
EO_putPrice = [24.5030619195, 6.4331983449, 0.4506517865]
EO_callDelta = [0.0004570682, 0.3531602156, 0.9281048725]
EO_putDelta = [-0.9995429318, -0.6468397844, -0.0718951275]
EO_callGamma = [0.0003270398, 0.0412892459, 0.0105424145]
EO_putGamma = [0.0003270398, 0.0412892459, 0.0105424145]
EO_callVega = [0.0408799729, 16.7221446014, 8.9083402750]
EO_putVega = [0.0408799729, 16.7221446014, 8.9083402750]
EO_callRho = [0.0108564724, 13.9615030448, 44.3786566108]
EO_putRho = [-49.4916352150, -35.5409886426, -5.1238350766]
EO_callTheta = [0.0041965620, 1.8118294906, 1.3346205936]
EO_putTheta = [-0.4908283549, 1.3168045737, 0.8395956767]
# Randomly Generated Normal Distribution of Numbers FOR TESTING
lstNormal = [1.1209715085108056, -1.853849540886473, -0.672088740267681, -0.29289778863491883,
0.4013323928666426, 0.6349702338012502, -0.7399836896101366, 0.08874904817822345, 0.7328658846711821,
-0.35043430431585715, 0.07076235580528148, -0.6678063657130521, -0.2768700451630374, 0.8476609830864915,
-0.8225539016737381, 1.2019726908687778, -0.1531960277450237, 1.7114990666848875, 0.17326816834754993,
1.0641028718131662, 0.3172084952939491, 0.5584937923000683, 0.8772122873468134, -0.6967987618663759,
0.8431216143486724, 0.8346021636944364, 1.3956703019829761, -1.5904909883580158, 0.5087692801610932,
0.616453621953588, -1.237477250422563, -0.08928462695812375, -0.02355641617225492, 0.1549122918336557,
-0.7844236214818284, -1.2822020657257207, -0.25589150139797795, -0.2838607476307214, 0.4331239841589263,
0.9944168889773274, -0.9369198983489831, -1.2516264689714578, -2.1316638828658103, 1.2938365465635764,
1.2112430574218935, 0.9136898730138675, 0.09058485862409764, -0.08477521510863507, 0.8516739744869886,
1.2902983336896563, -0.2742999058655753, 0.5337839805839412, 0.6125628801859652, -0.5044578767594319,
-0.49188771487890115, 1.496198497023411, -0.7542237711562569, -0.962463383744416, -0.3585004715070536,
-0.7423891341023111, 0.21830187548225996, -0.5151437842207627, -0.28223269894835123, 0.5784720287993612,
0.4726564889454145, 0.32568937997554126, -0.8202891792472182, -0.33909858685659, 0.8527539024062853,
0.1938232105765396, 2.0789383429945016, 0.4650723975302977, 1.3332700259620371, 1.0197149953978821,
-0.6633903401568217, 0.15721459357043877, 0.5926225470145295, 0.3417488954877983, -0.034017315577459524,
0.08548608025519096, -0.4974983957686862, -0.8441229651320409, -0.23043442767382194, -1.0006733584324263,
-1.1896849185629992, 0.6844891571733386, 0.3704143089078533, 0.18375357715901752, 1.06402824889337,
-0.2599834125185544, 0.1369435819154443, -0.800482792450961, -1.5556308770941492, -0.9111668859740867,
-1.0592822122328882, -0.20558560341090718, 0.5462299099826107, -2.960928638864658, 0.8227732012132655,
-0.8342429537014918, 0.9862982170633418, 1.2543395333979916, 0.31346876646488286, -0.520286733796006,
-1.167420482655948, -1.3417747277695151, -0.2951627916779075, -1.939541059898725, 0.3845512102771378,
0.35913537670573914, 0.7121201498607737, 0.6895899037482676, -1.3004502136037561, 1.8249030572650065,
0.5850819433766283, 1.15005722663063, -0.3996112437431802, 0.09943122413168726, -0.36154143405324296,
-1.4692521540951111, 0.8281616233147806, -1.1155679110152485, -0.20024735359097134, -1.2197837142459917,
0.2756198412187089, 0.4528070244879967, 0.3201296967629834, 1.0082953881208816, 2.2513057909175886,
0.9358219053525245, -1.7659464184992613, 0.1676022807557921, 0.5911462839239687, 0.9010061404403007,
-0.5164623210767869, 0.152728225754336, 0.34245530559325393, 0.6450768072489347, -0.4797175739253317,
-1.1138601142355689, -0.09122411425977918, -0.6691060025957402, 0.5412811828959523, 0.35742242391598406,
0.7081919606175261, -0.2875397852121618, -0.3802380425365222, 0.32582093857135147, 0.36067360296298934,
1.2358529725124692, 0.6807606115226454, -0.2746345222642817, 0.3712767571763352, -0.7251714933856145,
0.6962193786089789, -0.13995262157382302, 1.0104784963121642, 1.0417659318474315, 1.5134647245841084,
0.9751559478870168, 0.45626012028651264, -1.02386122867607, -1.9171103732051542, -0.46904177897522087,
0.44685004177927806, -1.2626622236454494, 0.18822205825975272, 0.05666837262394726, -1.0298046710300162,
1.326484788505604, 0.9059090468539794, -1.0163621655091413, 0.3166799051377914, 0.8394596593902709,
-0.11671521726475398, -0.04299063686885466, -0.23430618193790834, -1.3293353445890137, -1.1612775723454967,
-1.9220283787177388, -0.08485198251379587, 1.5375632460069373, -1.268818700263918, 0.042334526711378176,
-1.3520419210820014, 0.2760807220031588, -1.126797263797196, -0.4608273963497388, -0.8509606481751438,
-1.5602066471802603, -0.8391614228619677, -0.7326820403462702, 2.37472449784567, 3.5030008309988694,
-2.417083178595098, 1.27385844025756, -0.1738902845822125, 0.02903061441892783, 0.06034952203764755,
-0.6428347296747672]
npNormal = np.array(lstNormal)
npNormal = np.reshape(npNormal,(1,-1))
# When comparing results for the fixed monte, we compare them to this level of accuracy
FN_ACCURACY = 0.0000000001
# These are the results that you should get from the Monte Carlo when the above random numbers are patched
# into the tests.
FN_CALL_PRICE = [0.0, 1.6618558447662914, 15.813060955330187]
FN_CALL_DELTA = [0.007356851210202004, 0.36383928142205135, 0.9426117847559875]
FN_CALL_GAMMA = [0.029427404840808018, 0.06283587789369496, 0.024209520373646348]
FN_CALL_VEGA = [0.0, 0.15306026752723745, 0.07242129258448399]
FN_CALL_THETA = [0.0, -0.0045894157546869695, -0.0031628983634433257]
FN_CALL_RHO = [0.0, 0.14355004827158052, 0.4479751506406118]
FN_PUT_PRICE = [24.52531916972249, 6.20543700030005, 0.3749040966752129]
FN_PUT_DELTA = [-0.9917300494992335, -0.6352493396271136, -0.05647749796232851]
FN_PUT_GAMMA = [0.02942740484081541, 0.06283587789369723, 0.02420952037364742]
FN_PUT_VEGA = [0.0030920258220288586, 0.15862591400692702, 0.08046055972173001]
FN_PUT_THETA = [0.0012715740938142484, -0.0033855833679557355, -0.0020268076837960287]
FN_PUT_RHO = [-0.49500016645378553, -0.3514501181821696, -0.04702501581311356]