FX PASSIONATA

## Black-Scholes-Merton formula

By jaguar1637 3202 days ago Comments (3) You know the so called "Black-Scholes-Merton" option formula, that actualy not is the Black-Scholes-Merton formula

• jaguar1637 3202 days ago

In the different implementations below we will use the symbols:

S= Stock price

X=Strike price

T=Years to maturity

r= Risk-free rate

v=Volatility

• jaguar1637 3202 days ago

should provide in mq4, something like this :

_______________________________________________________

#define Pi 3.141592653589793238462643

#define a1  0.31938153

#define a2 -0.356563782

#define a3 1.781477937

#define a4 -1.821255978

#define a5 1.330274429

// The Black and Scholes (1973) Stock option formula

double BlackScholes(string CallPutFlag, double S, double X, double T, double r,double v)
{
double d1, d2;

d1=(MathLog(S/X)+(r+v*v/2)*T)/(v*MathSqrt(T));
d2=d1-v*MathSqrt(T);

if(CallPutFlag == 'c')
return( S *CumulDistrib(d1)-X * MathExp(-r*T)*CumulDistrib(d2);
else

if(CallPutFlag == 'p')
return( X * MathExp(-r * T) * CumulDistrib(-d2) - S * CumulDistrib(-d1);
}

// The cumulative normal distribution function
double CumulDistrib( double X )
{

double L, K, w ;

L = MathAbs(X);
K = 1.0 / (1.0 + 0.2316419 * L);
w = 1.0 - 1.0 / MathSqrt(2 * Pi) * MathExp(-L *L / 2) * (a1 * K + a2 * K *K + a3 * MathPow(K,3) + a4 * MathPow(K,4) + a5 * MathPow(K,5));

if (X < 0 )

{
w= 1.0 - w;
}
return(w);
}

______________________________________

So , easy to implement !!!  I think there are some people waiting for this kind of oscillator , isn't it ??

• zkogan 3114 days ago

Recently read a small article about these guys, very interesting stuff they created :D But what will the use be? Your formulas after BSM formula make the readings an oscillator (// The cumulative normal distribution function )?

I presume, if used without any modification, the indie can be something like a VWAP, but more precise (or will it?).