Salut à tous,
j'ai enfin réussi à faire ma page asp... Mais il me reste un petit problème que je ne comprends pas très bien encore...
Je mets mon code en bas de la page.
Lorsque j’exécute mon programme ma page s'ouvre bien mais lorsque je mets mes données il est écrit : System.Double[,] en réponse et je ne sais pas pourquoi...

merci de votre aide

Voici mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace WebApplication1
{
    public partial class About : System.Web.UI.Page
    {
       protected void resultat_Click(object sender, EventArgs e)
        {
            var S = double.Parse(s.Text);
            var r = double.Parse(rate.Text);
            var K = double.Parse(k.Text);
            var N = int.Parse(n.Text);
            var Sigma = double.Parse(sigma.Text);
            var T = double.Parse(t.Text);
            string CallPut = callput.Text;
 
            double[,] Spot = new Double[N + 1, N + 1];
            double[,] Payoff = new Double[N + 1, N + 1];
            double[,] Prix = new Double[N + 1, N + 1];
            double[,] Delta = new Double[N + 1, N + 1];
 
 
 
            // Initialisation des variables
 
            double delta_t = (double)T / N;
            double u = 0.0;
            double d = 0.0;
            //double rn = 0.0;
            double p = 0.0;
 
            // Calcul de u et de d en fnct du modèle choisit (CRR, Tian, Jr)
 
            if (mode.Text == "CRR")
            {
                u = Math.Exp(Sigma * Math.Sqrt(delta_t));
                d = 1 / u;              // Math.Exp(-Sigma * Math.Sqrt(delta_t));
                p = (Math.Exp(r * delta_t) - d) / (u - d);
            }
 
            // Calcul de p et q en fonction de u et d
 
            double q = 1 - p;
            double test;
 
            // Calcul du spot et payoffen fonction du call et du put
 
            if (callput.Text == "Call")
            {
                test = 1;
            }
            else
            {
                test = -1;
            }
 
            for (int j = 0; j <= N; j++)
            {
                for (int i = 0; i <= j; i++)
                {
                    Spot[i, j] = S * Math.Pow(u, i) * Math.Pow(d, j - i);
                    //Label1.Text = Spot.ToString();
                    Payoff[i, j] = Math.Max(test * (Spot[i, j] - K), 0);
                    //Label1.Text = Payoff.ToString();
                }
            }
 
            //Initialisation de la derniere colonne du prix avec le payoff
 
            for (int j = 0; j <= N; j++)
            {
                Prix[j, N] = Payoff[j, N];
                //Label1.Text = Prix.ToString();
            }
 
            //Calcul du prix du delta   
 
            if (exercice.Text == "EU")
            {
                for (int i = N - 1; i >= 0; i = i - 1)
                {
                    for (int j = 0; j <= i; j++)
                    {
                        double actualisation = Math.Exp(-r * delta_t);
 
                        Prix[j, i] = actualisation * (p * Prix[j + 1, i + 1] + q * Prix[j, i + 1]);
                        Delta[j, i] = (Prix[j + 1, i + 1] - Prix[j, i + 1]) / (Spot[j + 1, i + 1] - Spot[j, i + 1]);
                       // Label1.Text = Prix.ToString();
                        Label1.Text = Delta.ToString();
                    }
 
                }
            }
 
            else
            {
                for (int i = N - 1; i >= 0; i = i - 1)
                {
                    for (int j = 0; j <= i; j++)
                    {
                        double actualisation = Math.Exp(-r * delta_t);
 
                        Prix[j, i] = Math.Max(Payoff[j , i], actualisation * (p * Prix[j + 1, i + 1] + q * Prix[j, i + 1]));
                        Delta[j, i] = (Prix[j + 1, i + 1] - Prix[j, i + 1]) / (Spot[j + 1, i + 1] - Spot[j, i + 1]);
                        //Label1.Text = Prix.ToString();
                        Label1.Text = Delta.ToString();
                    }
                }
            }
 
 
 
        }
    }
}
Nom : appli.jpg
Affichages : 94
Taille : 48,4 Ko