Example #1
0
s_name = "Rate_History"
s_fx_name = "FX_Curve_History"
s_opt_name = "Vol_Surface"

sheet_name = "Pricer"
opt_source = "LIVE"
db_name = "Yield_Curve"

# Spot FX market
fx_spot = reader.read_FX_rates(fx_name)
# Libor rate market
cv_instrument = reader.read_instruments(s_name, 8)
# FX rate market
cv_fx_instrument = reader.read_instruments(s_fx_name, 8)
# Volatility normal market
vol_instrument = reader.read_vol(s_opt_name, 4)
""" Start Pricing and Setting up pricing objects
"""
disc_cv_details = {"type": "LIBOR", "spread": 0}

reader.close()  # Reslease workbook

vol_s = Vol.Val_Surface(val_date, vol_instrument)

OPT = OPT.OPTer(cv_instrument, vol_s)

inst = OPT.gen_opt_instruments(inputs)
ans_bk = OPT.price_opt(inst, val_date)
""" Start pricing and output to Pricer sheet
"""
# Writting to excel
Example #2
0
"""
import DB.dbExecute as dbEx
from IO import Reader as Reader
from Live_Pricing import Vol_Live as Vol
from Live_Pricing import OPT_Pricer as OPT
# Step one load current market vol data
# also load current market rates data
f_name = "Live Pricing.xlsm"
s_name = "Vol_Surface"
sdate  = "2019-03-25" 
schema_name = "Yield_Curve" 
tb_opt = "vcub"
opt_source = "LIVE"
num = 4
Reader = Reader.excel_reader(f_name)
data   = Reader.read_vol( s_name, num )

vol_s = Vol.Val_Surface( sdate,
                         schema_name,
                         tb_opt )
vol_s.get_raw_data( opt_source, data )

# Step two load option/swaption balance schedule
balance_name = "Schedule"
Reader.read( balance_name )
name, raw_data = Reader.get_raw_data()
cv_instrument  = Reader.read_instruments("Rate_Live", 8)
disc_cv_details = { "type" : "LIBOR",
                    "spread" : 0 }

# Step three option/swaption pricing