Theoretic option price
Author: Starburst
Creation Date: 11/20/2014 6:11 PM
profile picture

Starburst

#1
Has anyone been able to calculate the theoretic option price of a stock if its value is X in WLP?
profile picture

Eugene

#2
profile picture

Starburst

#3
Thank you Eugene for responding to my post.

I hope you don't mind trying to make this a little more clearer for me.

CODE:
Please log in to see this code.


price, Is this the Stock price?

price + 5.0d, Is price now the Strike price? What is + 5.0d?

60, Days to expiry, could you provide an example code to calculate this.

1d, rate=1% Does this always stay the same?

20.0 ); Does volatility always stay the same? If not how do I calculate this in WLP?

// days=60, rate=1%, volatility=20%=0.20

profile picture

Eugene

#4
If you look up the "Parameter Description" block in the manual, Price is indeed the stock price. It's pretty obvious and self-descriptive:
CODE:
Please log in to see this code.


QUOTE:
What is + 5.0d?

It's an arithmetic operation. If you're asking such questions, then you're going to benefit from following links from this FAQ: How do I start with C# ?

QUOTE:
60, Days to expiry, could you provide an example code to calculate this.

Please use Google/MSDN on how to subtract dates. This is again C# 101. For example: C# DateTime Subtract

QUOTE:
1d, rate=1% Does this always stay the same?
20.0 ); Does volatility always stay the same? If not how do I calculate this in WLP?

Again, these also are inputs, inputs are variables (from the word "vary"), so use whatever you like. Volatility for example can be calculated using the built-in indicator of the same name and then turning it into percentage.
profile picture

Starburst

#5
Eugene please bear with me because I am nowhere close to the option price. I hope you can correct my mistake.

I am using ticker symbol MA. Friday’s closing price was $84.72. December’s 85 strike call was $1.40 and put was $1.60. From Fidelity’s web site they show an Implied Volatility of "IV30 = 16.74". Entering these values into the following script returns Call = 0.16 Put = 0.17. What am I doing wrong?
CODE:
Please log in to see this code.

profile picture

Eugene

#6
You were pretty close but if the desired target price is 85, you're passing 90 to the formula. Here's a correction:

CODE:
Please log in to see this code.


Assuming MA at 11/21/2014, here's the output which matches the Fidelity website pretty much:

QUOTE:
Call = 1.40 Put = 1.62


P.S. I don't know which risk-free rate the Fidelity website assumes. Seems like 1.0% is going to work while the current figure of a 3-month T-Bill is rather 0.01.
profile picture

Starburst

#7
Thank you for clearing that up for me.
This does bring me to my next dilemma. How do I get WLP to provide the correct volatility value and risk free rate?
Using the Volatility indicator provided in WLP I don’t know the correct parameter values to return 16.74 value I see at Fidelity.

CODE:
Please log in to see this code.

profile picture

Eugene

#8
You need implied volatility. Most all existing indicators are documented in the Wiki. I'm not an expert in options so it's up to you how implied volatility is calculated and which indicator is the closest (I'm not sure if it exists or not).

And it's again up to you to investigate where to find the risk-free rate. We've developed tons of static data providers, some of them could deliver the T-Bill data (or you may hardcode the value you trust).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).