Hi robotekkers, thank you for the script!

I am trying to use the contractVal function, but obviously I am making some mistake, because it doesn't work.

So I found your script and it doesn't work too. I am trying to find out what is the problem.

I am using your code, but I deleted the yield function, because I don't have Zorro S yet.

My script:
Code:
// The script is not set to enter any trades, just solely to observe what is retrieved from the
// contractval and contractvol functions

#include <r.h>
#include <contract.c>

void run() 
{
	BarPeriod = 1440;
	assetList("assetsIB");
	assetHistory("SPY",FROM_YAHOO|UNADJUSTED);
	asset("SPY");
	
	if(is(INITRUN)){
		initRQL();
		dataLoad(1,"SPY_Options.t8",9);
	}
	
	Multiplier = 100;
	contractUpdate("SPY",1,CALL|PUT);
	int Type = PUT; // Then change to CALL to see difference
	var delta_check = 0;
	var strike_price = 0;
	var con_value;
	var current_IV;
	var Dividend = 0.02;
	var HistVolOV = VolatilityOV(20);
	var Interest = 0.01*2; // original: var Interest = 0.01*yield();

	strike_price = priceClose();
	CONTRACT* dtest = contract(Type,30,strike_price); 
	con_value = contractVal(dtest,priceClose(),HistVolOV,Dividend,Interest,&delta_check);
	if(!is(FIRSTINITRUN)) current_IV = contractVol(dtest,priceClose(),HistVolOV,con_value,Dividend,Interest);

	watch("!S_$",strike_price,"C_V",con_value,"D",delta_check,"IV",current_IV);	
}



The result is this error:
Error 111: Crash in script: contractVal()

I am not even sure, if my RQuantLib is installed properly or where might be the mistake. If you have any idea, for example how can I make sure that my RQuantLib is installed properly (test script for R works fine) or what might be the mistake, I'll be happy for any help!