The scope of this project was to create Rcpp package to simulate path-dependent option pricing with Monte Carlo method. I consider a European style up-and-out call option with a barrier active between the moment of pricing and the option expiry. The goal of the project was to study how individual variables affect option pricing. Included in the report are analyses of how the option price is affected by the value of the barrier level, volatility rate and time to maturity. In addition, the relationship of how simultaneously both factors (volatility rate and time to maturity) affect option pricing is analyzed.
Theory
A condition of the European up-and-out
call option is that it is canceled when, at any time during its term,
the option price exceeds the level of a set barrier. In order for this
option to make a profit for the holder, the price of the asset should be
higher than the strike price on the redemption date. When the option
price is lower than the strike price, the holder is not profitable to
exercise the option and its value is then 0. The profit for the holder
of a European up-and-out call option is therefore the difference between
the final price between the price on the redemption date and the strike
price (assuming that in none of the previous periods the price has
exceeded the barrier and the difference between its price and the strike
price is greater than zero).
EUoutCalloptionPricer package and load
librariesThe source code of the package is pushed to private repository on
github.com. To install the package from a private
repository, I created a special authorization token. I did this in order
to hide my solutions from other students (according to Honor
Code). To access the raw code of the package, please contact
me.
I use here renv package (knitting may take a
while!). Alternatively, in order to install the package please
use the following command:
devtools::install_github("szymonsocha/monte-carlo-option-pricing/package/EUoutCalloptionPricer", auth_token = "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")
The function can take any user-specified parameters for: number of price changes, price of the underyling at the moment of option pricing, strike price, barrier level, annualized volatility rate, annualized risk-free rate, time to maturity and number of iterations in Monte Carlo simulation.
However, for the purposes of this report (according to the guidelines), the default function values are as follows:
The default number of Monte Carlo simulation iterations is 1000 (nReps = 1000).
In order to determine the optimal value of the barrier level, I simulate the value of the option depending on its value.
Analysis of the chart allows us to conclude that for any barrier level value below 100 the value of the option is equal to 0. This is because 100 is the strike price. Below this value, it is not profitable to exercise option options. It is also interesting that the value of options even for large values reaches a maximum level of about 8 and does not increase further. This may be because the volatility of the option is too low for the option price to reach some extreme values during this period.
For the purposes of the report, I choose a barrier level value of b = 130. This is a purely arbitrary choice.
In the next step, I look at how change in volatility rate affects the option price.
It can be observed that for small and sufficiently large values of volatility rate, the option price is low. This is because the high volatility of the asset causes the chance of ‘hitting’ the right price range (above strike price and below barrier level) to decrease. The blue vertical line indicates the value indicated in the task instructions.
In the next step, I check how the change in time to maturity affects the option price.
By analyzing the chart, it can be seen that initially, as the time to maturity increases, the option price increases reaching its highest value for about 0.5. Then the option price decreases. This can be explained by the fact that the smaller the time to maturity, the probability that in a short time the price of the asset will reach a satisfactory level. The decreasing price for large values of time to maturity can be explained by the fact that for longer periods the probability that the price of the asset will change significantly increases. The blue vertical line indicates the value indicated in the task instructions.
Finally, I analyze how a simultaneous change in volatility rate and time to maturity affects the option price.
The results obtained are in line with those obtained earlier from a separate analysis of the two variables. A tradeoff between volatility rate and time to maturity is noted. The lower the value of the volatility rate, in order to maintain a high option price, it is necessary to increase the time to maturity. Conversely, the greater the value of the volatility rate, the smaller the time to maturity should be (in order to maintain a high option price).
This can be explained as follows. With high volatility in the price of the asset, the time to maturity should be as early as possible so that the price does not have time to change too much. Looking from the side of time to maturity, to keep the option price high, volatility rate should be relatively low.
The goal of the project was to build an Rcpp package, test it and draw conclusions on how the various option parameters affect its pricing. It was found that too low and too high volatility rates negatively affect option pricing. Similar conclusions were noted for the time to maturity rate. However, in this case, the sensitivity of option valuation to a change in the time to maturity rate was not as great. Finally, the relation between the theoretical price of the option and two factors (simultaneously) was analyzed. It confirmed earlier observations and observed a tradeoff between volatility rate and time to maturity due to option pricing.
In accordance with the Honor Code, I certify that my answers here are my own work, and I did not make my solutions available to anyone else.