[R-SIG-Finance] Option pricing, basic question
josh.m.ulrich at gmail.com
Thu Jun 16 18:10:36 CEST 2016
On Thu, Jun 16, 2016 at 9:45 AM, thp <thp at 2pimail.com> wrote:
> Hello Frank / all,
> the getSymbols() code written down before in relation to my option pricing
> question (see citation below)
> somehow did not work with me. I got
> Version 0.4-0 included new data defaults. See ?getSymbols.
> Warning messages:
> 1: package .quantmod. was built under R version 2.14.2
> 2: package .Defaults. was built under R version 2.14.2
> getSymbols('DGS3MO', verbose=TRUE,src='FRED')
> As of 0.4-0, .getSymbols. uses env=parent.frame() and
> auto.assign=TRUE by default.
> trying URL
> Error in download.file(paste(FRED.URL, "/", Symbols[[i]], "/",
> "downloaddata/", :
> cannot open URL
> This is even though I could download the data at the specified url manually.
This has been fixed for almost a year. You need to upgrade.
> On 2016-06-09 15:42, Frank wrote:
>> I use the 3-month constant maturity Treasury bill rate from FRED (Federal
>> Reserve Economic ??Database??) for the risk-free rate. For options with
>> substantially more than 3 months until expiration, I think it makes sense
>> use a maturity that best matches the option. The R code I use is:
>> ## Get DGS3MO Treasury yield from FRED
>> DGS3MO<-na.locf(DGS3MO/100.0,na.rm = TRUE)
>> file_name <- "DGS3MO.csv"
>> write.zoo(DGS3MO, file = file_name, append = FALSE, quote = TRUE, sep =
>> I run this text from a batch file in Windows 7 Pro 64-bit. The text in the
>> batch file is:
>> REM on Microsoft Windows (adjust the path to R.exe as needed)
>> DEL *DGS3MO.csv
>> "C:\Program Files\R\R-3.2.2\bin\x64\R.exe" CMD BATCH
>> COPY DGS3MO.BAT DGS3MO.BAK
>> COPY DGS3MO.TXT DGS3MO.TXT.BAK
>> REM PAUSE
> R-SIG-Finance at r-project.org mailing list
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
Joshua Ulrich | about.me/joshuaulrich
FOSS Trading | www.fosstrading.com
R/Finance 2016 | www.rinfinance.com
More information about the R-SIG-Finance