Blog
How to Calculate Implied Volatility in Python
Implied volatility tells us the expected volatility of a stock over an option's lifetime. Implied volatility is directly influenced by the supply and demand of the options and the market's expectation of the direction of the price of the underlying security. As...
How to Derive Options Greeks from the Black-Scholes Formula
Options Greeks are a set of quantities representing an option's price sensitivity to its underlying parameters. Each of them measures a different dimension of the risk in an option position. They fall out elegantly from derivatives of the Black-Scholes options pricing...
Black-Scholes Option Pricing in C++
The Black-Scholes or Black-Scholes-Merton model is a financial mathematical equation for pricing options contracts and other derivatives. Fischer Black and Myron Scholes published the formula in their 1973 paper "The Pricing of Options and Corporate Liabilities"....
Black-Scholes Option Pricing in Python
The Black-Scholes or Black-Scholes-Merton model is a financial mathematical equation for pricing options contracts and other derivatives. Fischer Black and Myron Scholes published the formula in their 1973 paper "The Pricing of Options and Corporate Liabilities"....
Black-Scholes Option Pricing in R
The Black-Scholes or Black-Scholes-Merton model is a financial mathematical equation for pricing options contracts and other derivatives. Fischer Black and Myron Scholes published the formula in their 1973 paper "The Pricing of Options and Corporate Liabilities"....
How to Solve R Error: unexpected ‘}’ in “}”
This error occurs when you have a closing curly bracket in your code without a corresponding opening curly bracket. You can solve this error by finding the position in your code that requires an opening bracket. This tutorial will go through how to solve the error...
How to Remove Legend in ggplot2
You can remove a legend from a plot using the syntax legend.position="none" for the plot theme. For example, library(ggplot2) ggplot(data = mtcars, aes(x = mpg, y = disp, color = vs)) + geom_point() + theme(legend.position="none") This tutorial will go through how to...
How to Solve R Error in file(file, ifelse(append, ‘a’, ‘w’)) : cannot open the connection
This error occurs if you try to write to a file in a directory that was not found by the R interpreter. You can solve this error by creating the directory using dir.create() or removing the missing directory from the file save path. For example, x <- c(rnorm(10))...
Center Plot Title in ggplot2
The easiest way to center a title using ggplot2 is to modify the plot.title component of the theme using element_text(hjust=0.5). For example, library(ggplot2) ggplot(data=mtcars, aes(x=mpg, y=wt)) + geom_point() + ggtitle("Automobile Weight vs Miles per Gallon") +...
How to Transpose a Data Frame in R
The easiest way to transpose a data frame is to use the transpose() function from the data.table library. For example, library(data.table) # get data data("mtcars") # transpose t_mtcars <- transpose(mtcars) # get row and colnames in order colnames(t_mtcars) <-...