Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, EternallyCurious, TipmyPip, Quad), 899 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Options - Financial Hacker #468491
10/07/17 09:46
10/07/17 09:46
Joined: Mar 2017
Posts: 65
G
Ger1 Offline OP
Junior Member
Ger1  Offline OP
Junior Member
G

Joined: Mar 2017
Posts: 65
I am trying to replicate the experiments from the financial hacker but I can't get the script OptionsSellRandom running properly.
In my case no trades are executed.

I ran all other options scripts from financial hacker and the results were the same as on the website. I also ran SPY-options for generating the curves and it worked too, so I guess the generation of artificial options data worked too.

Can anyone advise what is going wrong and why no trades are generated when running OptionsSellRandom ?

Re: Options - Financial Hacker [Re: Ger1] #468506
10/08/17 18:30
10/08/17 18:30
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
I once had the same problem and finally I realized that my R installation had a dependency to RQuantlib missing (I believe it was Rcpp but I am not sure anymore ...).
General question to the R experts here: does R (on Windows) offer any indiction of such missing dependencies?

Re: Options - Financial Hacker [Re: mhdus] #468514
10/09/17 06:25
10/09/17 06:25
Joined: Mar 2017
Posts: 65
G
Ger1 Offline OP
Junior Member
Ger1  Offline OP
Junior Member
G

Joined: Mar 2017
Posts: 65
Thanks for your suggestion. The thing is I got Rcpp with quantlib.

Is there another way to find out if the .t8 file has been created properly?

I still try to understand the basics of options scripts ...

Re: Options - Financial Hacker [Re: Ger1] #468520
10/09/17 08:27
10/09/17 08:27
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt

Re: Options - Financial Hacker [Re: jcl] #468722
10/13/17 23:15
10/13/17 23:15
Joined: Mar 2017
Posts: 65
G
Ger1 Offline OP
Junior Member
Ger1  Offline OP
Junior Member
G

Joined: Mar 2017
Posts: 65
Thanks a lot jcl, that was it!

It did not install properly. It took me some time to figure out how to install it properly.
If anyone faces the same issue, below link did it for me:

https://stackoverflow.com/questions/39849542/installation-of-rquantlib

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
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

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,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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:

Code:
> 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
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

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.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1