1. 1.
    0
    kankalar bu zıkkım niye çalışmıyo:

    6. include <cstdlib>
    7. include <ctime>
    8. include <iostream>
    9. include <cmath>
    10. include "normdist.h"

    using namespace std;

    //normal distribution

    double N(const double& z) {
    if (z > 6.0) { return 1.0; };

    if (z < -6.0) { return 0.0; };
    double b1 = 0.31938153;
    double b2 = -0.356563782;
    double b3 = 1.781477937;
    double b4 = -1.821255978;

    double b5 = 1.330274429;
    double p = 0.2316419;
    double c2 = 0.3989423;
    double a=fabs(z);
    double t = 1.0/(1.0+a*p);

    double b = c2*exp((-z)*(z/2.0));
    double N = ((((b5*t+b4)*t+b3)*t+b2)*t+b1)*t;
    N = 1.0-b*N;
    if ( z < 0.0 ) N = 1.0 - N;
    return N;
    };

    // greeks calculation

    void option_price_partials_call_black_scholes( double S, // spot price
    double X, // Strike (exercise) price,
    double r, // interest rate
    double sigma, // volatility
    double time, // time to maturity
    double& Delta, // partial wrt S
    double& Gamma, // second prt wrt S
    double& Theta, // partial wrt time
    double& Vega, // partial wrt sigma
    double& Rho){ // partial wrt r
    double time_sqrt = sqrt(time);
    double d1 = (log(S/X)+r*time)/(sigma*time_sqrt) + 0.5*sigma*time_sqrt;
    double d2 = d1-(sigma*time_sqrt);

    Delta = N(d1);
    Gamma = N(d1)/(S*sigma*time_sqrt);
    Theta =- (S*sigma*N(d1)) / (2*time_sqrt) - r*X*exp( -r*time)*N(d2);
    Vega = S * time_sqrt * N(d1);
    Rho = X * time * exp(-r * time) * N(d2);

    };

    gelen hata mesajı:

    undefined reference to 'Winmain@16'
    bu ne beahhhh?
    ···
  1. 2.
    +1
    17. satırı çıkarıp zütüne sokarsan düzelir
    ···
  2. 3.
    0
    yoooohhhh olmiyiiiiiiiii
    ···
  3. 4.
    0
    aloooooooooooooo
    ···
  4. 5.
    +1
    amacın nedir aq
    ···
  5. 6.
    +1
    ıı tak yedın ne sıkıme geldın
    ···
  6. 7.
    0
    amaç delta gamma rho bilmem neyi hesaplamak

    ya bi bakın 2 dakka çok ufak bişiyi ekgib ama neyi ekgib
    ···
  7. 8.
    0
    la laaaaa
    ···
  8. 9.
    +1
    ···
  9. 10.
    0
    lan yok mu anlayan
    ···
  10. 11.
    +1
    getchar
    getchar
    return(0)
    }
    hadi bana eyvallah
    ···
  11. 12.
    0
    lan bi el atın sevaptır
    ···
  12. 13.
    0
    alooooooooo
    ···
  13. 14.
    +1
    if (z > 6.0) { return 1.0; };
    iften sonra noktalı virgül kullanılır mı muallak şimdi gibtir git
    ···
  14. 15.
    0
    kanka son hali bu:

    11. include <cstdlib>
    12. include <ctime>
    13. include <iostream>
    14. include <cmath>
    15. include "normdist.h"

    using namespace std;

    //normal distribution
    double N(const double& z) {
    if (z > 6.0) { return 1.0; };
    if (z < -6.0) { return 0.0; };
    double b1 = 0.31938153;
    double b2 = -0.356563782;
    double b3 = 1.781477937;
    double b4 = -1.821255978;
    double b5 = 1.330274429;
    double p = 0.2316419;
    double c2 = 0.3989423;
    double a=fabs(z);
    double t = 1.0/(1.0+a*p);
    double b = c2*exp((-z)*(z/2.0));
    double N = ((((b5*t+b4)*t+b3)*t+b2)*t+b1)*t;
    N = 1.0-b*N;
    if ( z < 0.0 ) N = 1.0 - N;
    return N;
    };

    // greeks calculation
    void option_price_partials_call_black_scholes( double S, // spot price
    double X, // Strike (exercise) price,
    double r, // interest rate
    double sigma, // volatility
    double time, // time to maturity
    double Delta, // partial wrt S
    double Gamma, // second prt wrt S
    double Theta, // partial wrt time
    double Vega, // partial wrt sigma
    double Rho){ // partial wrt r
    double time_sqrt = sqrt(time);
    double d1 = (log(S/X)+r*time)/(sigma*time_sqrt) + 0.5*sigma*time_sqrt;
    double d2 = d1-(sigma*time_sqrt);
    Delta = N(d1);
    Gamma = N(d1)/(S*sigma*time_sqrt);
    Theta =- (S*sigma*N(d1)) / (2*time_sqrt) - r*X*exp( -r*time)*N(d2);
    Vega = S * time_sqrt * N(d1);
    Rho = X * time * exp(-r * time) * N(d2);
    };

    int main (void) {

    double S = 0.0;
    double X = 0.0;
    double r = 0.0;
    double Sigma = 0.0;
    double time = 0.0;
    double Delta= 0.0;
    double Gamma= 0.0;
    double Theta= 0.0;
    double Vega= 0.0;
    double Rho= 0.0;

    printf("please enter the parameters S, X, r, Sigma, time:n");
    scanf("%lf %lf %lf %lf %lfn", &S, &X, &r, &Sigma, &time);
    printf("you entered: S=%f, X=%f,r=%f, Sigma=%f,time=%f",S, X, r, Sigma, time);

    option_price_partials_call_black_scholes(S, X, r, Sigma, time, Delta, Gamma, Theta, Vega, Rho);
    printf("results are: Delta=%f, Gamma=%f,Theta=%f, Vega=%f,Rho=%f",Delta, Gamma, Theta, Vega, Rho);

    }

    olmuyo yine olmuyo gibtiimin kodu yine olmuyo
    ···
  15. 16.
    0
    lan internete baktım millete obeb-okek vermisler odev diye bize verilen ise bak ak yeaaaa
    ···
  16. 17.
    +2
    cCc Turbo Pascal giber cCc
    read(inci);
    inci:= spot + giber
    ···
  17. 18.
    +1
    son hatayı ver amcık
    ···
  18. 19.
    +1
    } sonrasındaki ; lkeri çıkar kurtul
    ···
  19. 20.
    0
    hata yok ak program çalışıyo ama S disindaki butun degiskenleri 0 aliyor. bu ne is yaaaaa
    ···