Options - page 5

 

Sketched out an indicator for calculating the theoretical price of an option.

Not sure if all formulas are correct. Who knows the maths, please check it.

 
Sergey Chalyshev:

Of course the spread has to be taken into account.

You could also test at a theoretical price, but that would be very crude. All the same, supply and demand may not exist in the real market.

Therefore, for accurate testing that is close to the real, we need the entire history of quotes with all the strikes and holes.

Historical volatility can also be twisted into a smile, you have to think about it.

If you can twist it realistically, let me know, I think it will be useful to all.)

The formulas:

  // private:
        private static double Erf(double x)
        {
            // constants
            double a1 = 0.254829592;
            double a2 = -0.284496736;
            double a3 = 1.421413741;
            double a4 = -1.453152027;
            double a5 = 1.061405429;
            double p = 0.3275911;

            // Save the sign of x
            int sign = 1;
            if (x < 0)
                sign = -1;
            x = Math.Abs(x);

            // A&S formula 7.1.26
            double t = 1.0 / (1.0 + p * x);
            double y = 1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.Exp(-x * x);

            return (sign * y);
        }

        public static double d1(InitalOptionData data)
        {
            return (Math.Log(data.S / data.K) + (data.r - data.q + Math.Pow(data.IV, 2) / 2) * data.T) / (data.IV * Math.Sqrt(data.T));
        }
        public static double d2(InitalOptionData data)
        {
            return d1(data) - data.IV * Math.Sqrt(data.T);
        }
        public static double N(double d)
        {
            return Erf((Math.Sqrt(2) * d) / 2) / 2 + 0.5;
        }
        public static double p(double d)
        {
            return 1 / Math.Sqrt(2 * Math.PI) * Math.Exp(-Math.Pow(d, 2) / 2);
        }
        private double Call(InitalOptionData data)
        {
            return data.S * Math.Exp(-data.q * data.T) * N(d1(data)) - data.K * Math.Exp(-data.r * data.T) * N(d2(data));
        }
        private double Put(InitalOptionData data)
        {
            return data.K * Math.Exp(-data.r * data.T) * N(-d2(data)) - data.S * Math.Exp(-data.q * data.T) * N(-d1(data));
        }

It's on sharpe if anything.

 

Question!

Can a "delta hedgerow" make money?

I have already formed my own opinion on this matter, I have already tested it.

But I would like to hear opinions on this matter, perhaps I am mistaken.

 

Option graph in MT5 RealTime


 
Sergey Chalyshev:

Option graph in MT5 RealTime

How did you get it?

 
Aleksey Vyazmikin:

How did you get it?

I join the question

 
By the way option charts are not necessary for trading - did you download the quotes for tests?
 
Aleksey Vyazmikin:

How did you get it?

It's obvious.

Quotes from Quickquotes, MT5 has a custom symbol that downloads these quotes.

 
prostotrader:

This is obvious.

Quotes from Quickquotes, MT5 has a custom symbol that downloads these quotes.

So that's the question, how to make such a bridge, which would be automatically loaded in real time?

 
prostotrader:

This is obvious.

Quotes from Quickquotes, MT5 has a custom symbol that downloads these quotes.

Useless crutch...

After that you still have to write a bunch of classes for option mathematics