Path: blob/master/src/FMNM/Parameters.py
1700 views
#!/usr/bin/env python31# -*- coding: utf-8 -*-2"""3Created on Mon Jun 10 09:56:25 201945@author: cantaro866"""789class Option_param:10"""11Option class wants the option parameters:12S0 = current stock price13K = Strike price14T = time to maturity15v0 = (optional) spot variance16exercise = European or American17"""1819def __init__(self, S0=15, K=15, T=1, v0=0.04, payoff="call", exercise="European"):20self.S0 = S021self.v0 = v022self.K = K23self.T = T2425if exercise == "European" or exercise == "American":26self.exercise = exercise27else:28raise ValueError("invalid type. Set 'European' or 'American'")2930if payoff == "call" or payoff == "put":31self.payoff = payoff32else:33raise ValueError("invalid type. Set 'call' or 'put'")343536