From my understanding brute force is a commonly used method to calculate IV if the option price is known. Is there anything wrong with the below method? price calculation is based on b&s model.
1) start with 0.5 default IV, calculate option price A
2) if A is within 0.05 difference of actual option price B, IV found
3) if A > B by more than 0.05, reduce IV to 90% and try again.
4) if A < B by more than 0.05, increase IV to 110% and try again.
For those of you who code, it's a simple recursive call.
double actualOptionPrice=10; //given
public double getIV(double iv)
{
double tempOptionPrice = calculateCall(iv);
double diff = tempOptionPrice - actualOptionPrice;
if(Math.abs(diff) <0.05) return iv;
else if (diff > 0) return getIV(iv*0.9);
else return getIV(iv*1.1); //if diff < 0
}
I did a bunch unit testing with different strikes, expiration, etc..they all worked correctly. Just wondering if anything i am missing with this approach.
1) start with 0.5 default IV, calculate option price A
2) if A is within 0.05 difference of actual option price B, IV found
3) if A > B by more than 0.05, reduce IV to 90% and try again.
4) if A < B by more than 0.05, increase IV to 110% and try again.
For those of you who code, it's a simple recursive call.
double actualOptionPrice=10; //given
public double getIV(double iv)
{
double tempOptionPrice = calculateCall(iv);
double diff = tempOptionPrice - actualOptionPrice;
if(Math.abs(diff) <0.05) return iv;
else if (diff > 0) return getIV(iv*0.9);
else return getIV(iv*1.1); //if diff < 0
}
I did a bunch unit testing with different strikes, expiration, etc..they all worked correctly. Just wondering if anything i am missing with this approach.
.