Question

You will be focused on: 1) understand the Black-Scholes model and its application: how it works,...

You will be focused on:
1) understand the Black-Scholes model and its application: how it works, what application areas it can be used
2) understand and follow the example to implement the Black-Scholes model in C++
3) test your implementation and make sure it works
write a report supporting such

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per the given information we can have following c++ program for it:


#include <iostream>
#include <cmath>
using namespace std;

double normalDistribution(double x)
{
  static const double RT2PI = sqrt(4.0*acos(0.0));
  static const double SPLIT = 10./sqrt(2);
  static const double a[] = {220.206867912376,221.213596169931,112.079291497871,33.912866078383,6.37396220353165,0.700383064443688,3.52624965998911e-02};
  static const double b[] = {440.413735824752,793.826512519948,637.333633378831,296.564248779674,86.7807322029461,16.064177579207,1.75566716318264,8.83883476483184e-02};
  
  const double z = fabs(x);
  double Nz = 0.0;
  
  // if z outside these limits then value effectively 0 or 1 for machine precision
  if(z<=37.0)
  {
    // NDash = N'(z) * sqrt{2\pi}
    const double NDash = exp(-z*z/2.0)/RT2PI;
    if(z<SPLIT)
    {
      const double Pz = (((((a[6]*z + a[5])*z + a[4])*z + a[3])*z + a[2])*z + a[1])*z + a[0];
      const double Qz = ((((((b[7]*z + b[6])*z + b[5])*z + b[4])*z + b[3])*z + b[2])*z + b[1])*z + b[0];
      Nz = RT2PI*NDash*Pz/Qz;
    }
    else
    {
      const double F4z = z + 1.0/(z + 2.0/(z + 3.0/(z + 4.0/(z + 13.0/20.0))));
      Nz = NDash/F4z;
    }
  }
  return x>=0.0 ? 1-Nz : Nz;
}

// return the value of a call option using the black scholes formula
double callOptionPrice(double S,double t,double X,double r,double sigma,double T)
{
  if(S<1.e-14)return 0.; // check if asset worthless
  if(sigma<1.e-14) // check if sigma zero
  {
    if(S<X*exp(-r*(T-t)))return 0.;
    else return S-X*exp(-r*(T-t));
  }
  if(fabs(T-t)<1.e-14) // check if we are at maturity
  {
    if(S<X)return 0.;
    else return S-X;
  }
  // calculate option price
  double d1=(log(S/X) + (r+sigma*sigma/2.)*(T-t))/(sigma*sqrt(T-t));
  double d2=(log(S/X) + (r-sigma*sigma/2.)*(T-t))/(sigma*sqrt(T-t));
  return normalDistribution(d1)*S - normalDistribution(d2)*X*exp(-r*(T-t));
}

int main()
{
  cout << "Call Option Price = " << callOptionPrice(1,0,1,0.05,0.2,1) << endl;
  return 0;
}
Add a comment
Know the answer?
Add Answer to:
You will be focused on: 1) understand the Black-Scholes model and its application: how it works,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This question is designed to make sure you know how to derive the Black-Scholes partial differential...

    This question is designed to make sure you know how to derive the Black-Scholes partial differential equation (pde). a) Write down the key assumptions of the Black-Scholes model. b) Why is Ito's lemma needed? c) Derive the Black-Scholes pde, d) What is the role of hedging? Why is this hedge portfolio also called a replicating portfolio? e) Why does the Black-Scholes pde not have a stochastic component?

  • Question 1 Consider the derivation of the Black-Scholes model of option pricing. Let S=S(t) be the...

    Question 1 Consider the derivation of the Black-Scholes model of option pricing. Let S=S(t) be the underlying stock price at time t and let f=f(S, t) be the option price at time t. a) Write down the value P of the portfolio defined in the Black-Scholes model. [2 marks] b) Use Itô’s lemma to find an expression for the change Δf in the discrete time Δt. [5 marks] c) Use the expression you have found in point b) to find...

  • 7. (10 pts) a In Black Scholes option pricing model explain what it means if N(d1...

    7. (10 pts) a In Black Scholes option pricing model explain what it means if N(d1 ) is 0.45 in terms of the movements in the stock and call option price. b. What is N(d1 ) referred to (what is the name) and what does it show? c. How many call options can you write on one share of stock if N(d1 ) is 0.5 in order to have a fully neutral hedged position?

  • show how its done. thank you Question #1: Use the Black-Scholes formula to find the value...

    show how its done. thank you Question #1: Use the Black-Scholes formula to find the value of a call option on the following stock: 6 months 50% per year Time to expiration Standard Deviation Exercise Price Stock Price Interest Rate $50 $50 10% Question #2: Find the value of put option on the stock in the previous problem with the same information above (Hint: there are two ways of calculating such value).

  • Understand the Application For this lab you will create a basic application programming interface (API) for...

    Understand the Application For this lab you will create a basic application programming interface (API) for spawning multiple threads in a program using Python3's threading module. The Program Spec Write a program that creates a minimum of two threads with different target functions. Each thread will perform the work of each function. Each function will compute a task (described below) and print out a result. Implementation Details Write a program that creates a minimum of two threads using Python's threading...

  • 100 1. How western blot does works and explain some of its possible application? 2. While...

    100 1. How western blot does works and explain some of its possible application? 2. While using the sample buffer (Leammli buffer), there was SDS (detergent). Why was the SDS necessary for running the gel? 3. Why was it necessary for the transfer to the nitrocellulose membrane? 4. The first stage of western blotting involves separating proteins using gel electrophoresis. On what basis does this technique separate proteins? 5. How can you test the efficiency of transfer of the protein...

  • can you comment so that I may understand how it works. 3. Write a C++ program...

    can you comment so that I may understand how it works. 3. Write a C++ program that does the following: Write a function (smallestindex) that has two parameters: an array containing elements of type int and the length of the array. The function returns the index of the array's smallest element. ii. Use the main function to call the smallestindex function

  • Need help to better understand this and how it works... What do you consider to be...

    Need help to better understand this and how it works... What do you consider to be the first and second priority in a sorting algorithm; and justify a key word or phrase to place in the string that is crucial. Provide a short pseudocode example in your discussion post to defend your thoughts. Explain your reasoning for selecting your first and second priorities.

  • The founder of an application would like to understand how the demand of users varies with...

    The founder of an application would like to understand how the demand of users varies with advertising spending. During the last 6 weeks, she collects the following user and advertising statistics : Week # users 452 523 487 576 687 6 / 475 costs 3 4 7 6 5 2 The manager considers the following regression model: Y; = Bo + B1X; +Ui, i = 1,.., 6 with Uị|X ~ii.d N(0,0%) (1) where Yi: “Number of active users in week...

  • D3: DB Specification & Implementation: After you have developed the conceptual E-R model for GG, convert...

    D3: DB Specification & Implementation: After you have developed the conceptual E-R model for GG, convert that data model into a relational database design for Garden Glory. Then develop the specifications for database implementation, indicating data types, PKs, and FKs. Implement the design and create the GG Database and execute a variety of queries to test the functionality of your DB. Document your database design and the processing results accordingly. You can also refer to the GG project questions in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT