0 registered members (),
1,089
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Options - Financial Hacker
[Re: Ger1]
#468520
10/09/17 08:27
10/09/17 08:27
|
Joined: Jul 2000
Posts: 27,987 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,987
Frankfurt
|
|
|
|
Re: Options - Financial Hacker
[Re: Ger1]
#468861
10/23/17 21:34
10/23/17 21:34
|
Joined: Jul 2016
Posts: 93 Düsseldorf, Germany
mhdus
Junior Member
|
Junior Member
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
|
I just had the same issue while installing Zorro and R on a new VPS.
I did follow the R installation instructions from the Zorro manual: there were no error messages but options-specific functions in Zorro were simply not working without any hint what could be wrong.
After following the installation instructions from the above stackoverflow URL the options functions in Zorro are working fine.
The test directly in the R console suggested by jcl is still not working, though:
> AmericanOption('put', strike=100, volatility=0.4, 100, 0.02, 0.03, 0.5, engine='CrankNicolson') Error in AmericanOption("put", strike = 100, volatility = 0.4, 100, 0.02, : could not find function "AmericanOption" >
I'm afraid I'm outing myself as a complete R idiot but I believe I'm not the only one ... So the Zorro manual may deserve a slight improvement in the RQuantLib installation (and eventually troubleshooting) instructions for those of us who are not familiar at all with R.
Thanks in advance.
|
|
|
Re: Options - Financial Hacker
[Re: mhdus]
#468869
10/24/17 07:39
10/24/17 07:39
|
Joined: Jul 2000
Posts: 27,987 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,987
Frankfurt
|
The problem with RQuantlib is that it is not in the standard R package repository. So you must install it either directly as described in the manual, or via DRAT as described in the Stackoverflow link. For this reason, dependencies such as Rcpp are also not automatically installed. This gives no error message, but calls to RQuantlib fail. So you must also manually install Rcpp. I believe that is the only dependency. The message "could not find function AmericanOption" means that RQuantlib itself is not linked or not installed. AmericanOption is heavily used by contractVal, so this function would then also fail. If all is correctly installed, the response from R is:
> library('RQuantLib',quiet=TRUE)
> AmericanOption('put', strike=100, volatility=0.4, 100, 0.02, 0.03, 0.5, engine='CrankNicolson')
Concise summary of valuation for AmericanOption
value delta gamma vega theta rho divRho
10.9173 -0.4358 0.0140 NA NA NA NA
I've added some details to the manual description.
|
|
|
Re: Options - Financial Hacker
[Re: jcl]
#468871
10/24/17 12:01
10/24/17 12:01
|
Joined: Jul 2016
Posts: 93 Düsseldorf, Germany
mhdus
Junior Member
|
Junior Member
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
|
Thanks. "library('RQuantLib',quiet=TRUE)" did the trick to make the AmericanOption() function work in the R console.
However, Zorro's ContractVal() function did already work before (I used the OptionsCurve script to test), so it appears as if Zorro could already use RQuantLib while R console could not.
Please note that while following the installation instructions from the stackoverflow URL above, Rcpp got installed automatically.
Thanks for the add-on to the manual.
Last edited by mhdus; 10/24/17 12:01.
|
|
|
|