|
I am very new to QuantLib and am hoping that it can help me. I want the ability to calculate the current value of a diagonal put spread traded in the United States. I am looking at diagonal spreads where one put is bought at a low strike price and distant expiration date and another put is sold at the current month at a strike closer to the stock price than the put that was bought. My current system does not have QuantLib objects. Instead, it has the following classes/variables:
stock
-ask
-bid
-last
-timestamp (of this quote)
-symbol
-....
option
-ask
-bid
-stock (pointer to above class)
-strike
-expiration
-type (put vs call)
-timestamp (of quote)
-...
I use these objects to define a position. For example, a diagonal spread would have two options (open and spread) each of which would point to a stock object at that same time. Then, I want to calculate the current value of the position relative to the current market position which is identified by another option object (close).
With these objects, I want to calculate possible outcomes:
-The gain/loss if the position was exercised.
-The gain/loss if the position was closed through purchasing the close option.
-The gain/loss if the position expired.
-Possibly other outcomes as well.
I hoping that QunatLib can help me with this analysis. I am willing to port my classes above to fit the QuantLib model, if QunatLib can analyze the outcomes above. I tried the VanillaOption class, but wasn't quite sure how to get it do the above calculations. Can someone provide some suggestions?
Also, if these types of calculations are not geared toward QuantLib, could someone please point me to a library that can help? Or at least a book or something that can mathematically layout these calculations so I can test my own code for errors?
Thank you so much for your time.
|