コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: GuillaumeFuchs/PEPS
        protected void Button1_Click(object sender, EventArgs e)
        {
            double t = double.Parse(TextBox1.Text);
            int H = int.Parse(TextBox2.Text);
            int size = 4;
            double[] spot = new double[] {  100, 100, 100, 100 };
            double[] sigma = new double[] { 0.2, 0.2, 0.2, 0.2 };
            double r = 0.05;
            double[] coeff = new double[] { .25, .25, .25, .25 };
            double[] rho = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
            double T = 6;
            int N = 6;
            int M = 50000;

            WrapperClass wc = new WrapperClass();
            double K = 0.0;
            wc.getPrice(t, size, spot, K, sigma, r, coeff, rho, T, N, H, M);

            Label1.Text = Math.Round(wc.getPrice(), 4).ToString();
            Label2.Text = Math.Round(wc.getICP(), 4).ToString();
            Label3.Text = Math.Round(wc.getPriceBS(), 4).ToString();
        }