Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering R for Quantitative Finance

You're reading from   Mastering R for Quantitative Finance Use R to optimize your trading strategy and build up your own risk management system

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781783552078
Length 362 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (15) Chapters Close

Preface 1. Time Series Analysis FREE CHAPTER 2. Factor Models 3. Forecasting Volume 4. Big Data – Advanced Analytics 5. FX Derivatives 6. Interest Rate Derivatives and Models 7. Exotic Options 8. Optimal Hedging 9. Fundamental Analysis 10. Technical Analysis, Neural Networks, and Logoptimal Portfolios 11. Asset and Liability Management 12. Capital Adequacy 13. Systemic Risks Index

The life of a Double-no-touch option – a simulation


How has the DNT price been evolving during the second quarter of 2014? We have the open-high-low-close type time series with five minute frequency for AUDUSD, so we know all the extreme prices:

d <- read.table("audusd.csv", colClasses = c("character", rep("numeric",5)), sep = ";", header = TRUE)
underlying <- as.vector(t(d[, 2:5]))
t <- rep( d[,6], each = 4)
n <- length(t)
option_price <- rep(0, n)

for (i in 1:n) {
  option_price[i] <- dnt1(S = underlying[i], K = 1000000, U = 0.9600, L = 0.9200, sigma = 0.06, T = t[i]/(60*24*365), r = 0.0025, b = -0.0250)
}
a <- min(option_price)
b <- max(option_price)
option_price_transformed = (option_price - a) * 0.03 / (b - a) + 0.92

par(mar = c(6, 3, 3, 5))
matplot(cbind(underlying,option_price_transformed), type = "l",
    lty = 1, col = c("grey", "red"),
    main = "Price of underlying and DNT",
    xaxt = "n", yaxt = "n",  ylim = c(0.91,0.97),
    ylab = "", xlab = "Remaining...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image