My Profile

Contact Details

Milesius Capital Resources LLC

Ribbons

Badges

Andrew Acosta

Milesius Capital Resources LLC

Bio

Andrew Paul Acosta earned a Masters of Business Administration with honors from Roosevelt University in Chicago, a Masters of Science in Financial Engineering at Illinois Institute of Technology, and a PhD in Knowledge Management from Walden University.

Andrew is the lead data scientist at Milesius Capital Resources LLC, a statistical consulting firm specializing in foreign currency trading, futures, swaps, fixed-income, and options, also offering expertise in clinical trials, biostatistics, financial risk management, economic research, operations research, and engineering in computing environments such as: AMPL, C++, R, SAS, MATLAB, Python, SQL, and LINGO.

Andrew teaches as an adjunct instructor at both land-based and online learning environments in finance, econometrics, time series analysis, statistical programming, information systems, and data science. He is the author of books on data science and operations research.

He draws upon two decades of financial engineering experience in derivatives pricing and risk management, including mortgage-backed securities and credit default swaps. He is a professional speaker invited to deliver presentations in data science, economic theory, finance, econometrics, financial regulation, operations research, and information systems management.

while True:
    print("Hello")


Here is the Nobel prize-winning options pricing algorithm by Black and Scholes

import math

# Cumulative Normal Distribution 5th order polynomial
def cnd(X):
    (a1,a2,a3,a4,a5) = (0.31938153, -0.356563782, 1.781477937, 
     -1.821255978, 1.330274429)
	 
    L = abs(X)
    K = 1.0 / (1.0 + 0.2316419 * L)
    w = 1.0 - 1.0 / math.sqrt(2*math.pi)*math.exp(-L*L/2.) * (a1*K + a2*K*K + a3*pow(K,3) +
    a4*pow(K,4) + a5*pow(K,5))
    
    if X<0:
        w = 1.0-w

    return w
    
# Black Scholes Function
def BlackScholes(CallPutFlag,S,X,T,r,v):
    d1 = (math.log(S/X)+(r+v*v/2.)*T)/(v*math.sqrt(T))
    d2 = d1-v*math.sqrt(T)
    
    if CallPutFlag=='c':
        return S*cnd(d1)-X*math.exp(-r*T)*cnd(d2)

    else:
        return X*math.exp(-r*T)*cnd(-d2)-S*cnd(-d1)