コード例 #1
0
ファイル: Form1.cs プロジェクト: benjellt/Monte-Carlo
        private void goBtn_Click(object sender, EventArgs e)
        {
            // Retrieve the values of the parameters in the TextBoxes
            WrapperClass wc = new WrapperClass();

            wc.getPriceCallEuro(nbSamples, maturity, S0, strike, sigma, r);
            prixLabel.Text = wc.getPrice().ToString();
            icLabel.Text   = wc.getIC().ToString();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: GuillaumeFuchs/Ensimag
        public Form1()
        {
            InitializeComponent();
            // Récupérer les valeurs des paramètres dans les différentes TextBox
            WrapperClass wc = new WrapperClass();
            double S0 = 100;
            double sigma = 0.2;
            double r = 0.095;
            double T = 1;
            double K = 100;
            int J = 12;
            int M = 50000;

            wc.getPriceOptionMC(S0, sigma, r, T, K, J, M);
            PrixMC_Lab.Text = wc.getPrice().ToString();
            ICMC_Lab.Text = wc.getIC().ToString();

            wc.getPriceOptionMCC(S0, sigma, r, T, K, J, M);
            PrixMCC_Lab.Text = wc.getPrice().ToString();
            ICMCC_Lab.Text = wc.getIC().ToString();
        }
コード例 #3
0
ファイル: Default.aspx.cs プロジェクト: pelletgu/PEPS
        public void price(object sender, EventArgs e)
        {
            // Récupérer les valeurs des paramètres dans les différentes TextBox
            WrapperClass wc = new WrapperClass();

            /*double strike = double.Parse(strike_tb.Text);
             * int size = int.Parse(size_tb.Text);
             * double r = double.Parse(r_tb.Text);
             * double he = double.Parse(h_tb.Text);
             * int sample = int.Parse(samples_tb.Text);*/


            //byte[] abyte1 = new byte[type.Text.Length];
            //System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            //abyte1 = encoding.GetBytes(type.Text);
            //sbyte[] baske = Array.ConvertAll(abyte1, q => Convert.ToSByte(q));
            String type = "basket";
            //double[] sigma = new double[5];
            //sigm[0] = double.Parse(sigma.Text);
            //double[] rho = new double[1];
            //ro[0] = double.Parse(rho.Text);

            // Valeurs manuels
            const int size   = 5;
            double    strike = 100;

            double[] spot = new double[size] {
                90, 80, 100, 120, 110
            };
            double maturity = 1;

            double[] sigma = new double[size] {
                0.2, 0.2, 0.2, 0.15, 0.15
            };
            double r = 0.05;

            double[] rho = new double[(size - 1) * size / 2] {
                0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2
            };
            double[] coeff = new double[size] {
                0.2, 0.2, 0.2, 0.2, 0.2
            };
            int timeStep = 1;
            int samples  = 50000;

            wc.getPriceOption(type, size, spot, strike, maturity, sigma, r, rho, coeff, timeStep, samples);

            prix_label.Text = wc.getPrice().ToString();
            ic_label.Text   = wc.getIC().ToString();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: GuillaumeFuchs/Ensimag
        static void Main(string[] args)
        {
            WrapperClass wc = new WrapperClass();
            double px, ic;
            int M = 50000;
            double T = 2;
            double S0 = 100;
            double K = 110;
            double L = 80;
            double sigma = 0.2;
            double r = 0.05;
            int J = 24;

            wc.getPriceOption(M, T, S0, K, L, sigma, r, J);
            px = wc.getPrice();
            ic = wc.getIC();

            System.Console.WriteLine("prix: %f\nic: %f\n", px, ic);
            System.Console.ReadKey();
        }
コード例 #5
0
ファイル: Default.aspx.cs プロジェクト: pelletgu/PEPS
        public void price(object sender, EventArgs e)
        {
            // Récupérer les valeurs des paramètres dans les différentes TextBox
            WrapperClass wc = new WrapperClass();
            /*double strike = double.Parse(strike_tb.Text);
            int size = int.Parse(size_tb.Text);
            double r = double.Parse(r_tb.Text);
            double he = double.Parse(h_tb.Text);
            int sample = int.Parse(samples_tb.Text);*/

            //byte[] abyte1 = new byte[type.Text.Length];
            //System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            //abyte1 = encoding.GetBytes(type.Text);
            //sbyte[] baske = Array.ConvertAll(abyte1, q => Convert.ToSByte(q));
            String type = "basket";
            //double[] sigma = new double[5];
            //sigm[0] = double.Parse(sigma.Text);
            //double[] rho = new double[1];
            //ro[0] = double.Parse(rho.Text);

            // Valeurs manuels
            const int size = 5;
            double strike = 100;
            double[] spot = new double[size] {90, 80, 100, 120, 110};
            double maturity = 1;

            double[] sigma = new double[size] { 0.2, 0.2, 0.2, 0.15, 0.15 };
            double r = 0.05;
            double[] rho = new double[(size - 1) * size / 2] { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 };
            double[] coeff = new double[size] { 0.2, 0.2, 0.2, 0.2, 0.2 };
            int timeStep = 1;
            int samples = 50000;

            wc.getPriceOption(type, size, spot, strike, maturity, sigma, r, rho, coeff, timeStep, samples);

            prix_label.Text = wc.getPrice().ToString();
            ic_label.Text = wc.getIC().ToString();
        }