#!/usr/bin/env python import os import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv)>1 else False) # Case A oreex.print_headline("Run ORE (case A (swap eur), 1st order regression)") oreex.run("Input/ore_A1.xml") oreex.get_times("Output/log_1.txt") oreex.save_output_to_subdir( "case_A_eur_swap", ["log_1.txt", "dim_evolution_1.txt", "dim_regression_1.txt"] ) oreex.print_headline("Run ORE (case A (swap eur), 2nd order regression)") oreex.run("Input/ore_A2.xml") oreex.save_output_to_subdir( "case_A_eur_swap", ["log_2.txt", "dim_evolution_2.txt", "dim_regression_2.txt"] ) oreex.print_headline("Run ORE (case A (swap eur), 2nd order (NPV) regression)") oreex.run("Input/ore_A3.xml") oreex.save_output_to_subdir( "case_A_eur_swap", ["log_3.txt", "dim_evolution_3.txt", "dim_regression_3.txt"] ) oreex.print_headline("Plot results")
import glob import os import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv) > 1 else False) # whithout collateral oreex.print_headline( "Run ORE to produce NPV cube and exposures, without collateral") oreex.run("Input/ore.xml") oreex.get_times("Output/log.txt") oreex.save_output_to_subdir( "collateral_none", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) # threshhold=mta=0 oreex.print_headline( "Run ORE to postprocess the NPV cube, with collateral (threshold=mta=0)") oreex.run("Input/ore_mpor.xml") oreex.save_output_to_subdir( "collateral_mpor", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*"))) + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "colva*")))) oreex.print_headline("Plot results") oreex.setup_plot("nocollateral_epe") oreex.plot(os.path.join("collateral_none", "exposure_trade_Swap_1.csv"), 2, 3,
import glob import os import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv) > 1 else False) # whithout collateral oreex.print_headline( "Run ORE to produce NPV cube and exposures, without collateral") oreex.run("Input/ore.xml") oreex.get_times("Output/log.txt") oreex.save_output_to_subdir( "collateral_none", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) # Threshhold>0 oreex.print_headline( "Run ORE to postprocess the NPV cube, with collateral (threshold>0)") oreex.run("Input/ore_threshold.xml") oreex.save_output_to_subdir( "collateral_threshold", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*"))) + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "colva*")))) # mta=0 oreex.print_headline( "Run ORE to postprocess the NPV cube, with collateral (threshold=0)") oreex.run("Input/ore_mta.xml")
#!/usr/bin/env python import glob import os import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv) > 1 else False) # LGM oreex.print_headline("Run ORE simulation in the LGM measure") oreex.run("Input/ore_lgm.xml") oreex.save_output_to_subdir( "measure_lgm", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) # FWD oreex.print_headline("Run ORE simulation in the FWD measure") oreex.run("Input/ore_fwd.xml") oreex.save_output_to_subdir( "measure_fwd", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) # BA oreex.print_headline("Run ORE simulation in the BA measure") oreex.run("Input/ore_ba.xml") oreex.save_output_to_subdir( "measure_ba", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*"))))
#!/usr/bin/env python import glob import os import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv) > 1 else False) oreex.print_headline("Run ORE to produce normal xva from BANKs view") oreex.run("Input/ore_Normal.xml") oreex.get_times("Output/log.txt") oreex.save_output_to_subdir( "NormalXVA", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) oreex.print_headline("Run ORE to produce flipped xva from CPTY_As view") oreex.run("Input/ore_FlipView.xml") oreex.get_times("Output/log.txt") oreex.save_output_to_subdir( "FlippedXVA", ["log.txt", "xva.csv"] + glob.glob(os.path.join(os.getcwd(), os.path.join("Output", "exposure*")))) oreex.print_headline( "Run ORE to produce normal xva with reversed swap (identical to flipped xva as BANK and CPTY_A have identical Default and fva curves)" ) oreex.run("Input/ore_ReversedNormal.xml") oreex.get_times("Output/log.txt") oreex.save_output_to_subdir( "ReversedNormalXVA", ["log.txt", "xva.csv"] +