Hi,
I am trying to find breakeven prices for a specific equity options trading strategy with different stock prices. The basic idea is as follows
1. Generate different stock prices from 1 to 80000
2. Calculate options value at different stock prices
3. Compare options value at different stock prices with the premium paid for strategy, the stock price is breakeven price when options value at this price equals to the premium. (it is possible to have two breakeven prices)
Here is my code:
'stock prices
a = 1
For i = 1 To 80000
BE_Sp(i) = a
a = a + 0.01
BE_Sp(i) = Format(BE_Sp(i), "0.00")
Next i
r = 1
Count = 0
For i = 1 To 80000
(code for calculating options value (Total_V))
If Total_V = -T_Prem Then
BE(r) = BE_Sp(i)
Count = Count + 1
r = r + 1
End If
If Count = 2 Then Exit For
Next i
If Count = 1 Then
Range("L39").Value = BE(1)
ElseIf Count = 2 Then
Range("L39").Value = BE(1) & "/" & BE(2)
End If
The problem is the options value is always a little different with the premium. For example, the premium is 209.55, the closest options values are 209.37 and 209.84. Would anyone show me how to pick the closest number? Thank you.
Bookmarks