SPY_Options.t8

Posted By: AFJG

SPY_Options.t8 - 09/30/17 17:19

I have successfully downloaded R and RQuantlib. I created a T6 file in "Yahoo" Format which comes out as Time, O,H,L,C,Spread,Vol.

I have run OptionSimulate.c without any apparent problems but the file seems to be a nonsense. I have looked at the struct in the manual and contract.c and opened the binary file with python / numpy since I am none too familiar with C.

ZHistoryEditor does not permit viewing of t8 files.

When I run the script contained here "http://www.financial-hacker.com/algorithmic-options-trading/" merely get a chart of the time series:
Code:
#include <contract.c>
void run() 
{
	BarPeriod = 1440;
	StartDate = 2004;
	EndDate = 2005;
	assetList("assetsFIX");
	//assetHistory("SP",FROM_YAHOO|UNADJUSTED);
	asset("VIX_2004");
	if(is(INITRUN)) dataLoad(1,"VXX_Options.t8",9);

	Multiplier = 100;
	contractUpdate("VIX_2004",1,CALL|PUT);	
	int Type = ifelse(random() > 0,CALL,PUT);
	contract(Type,30,priceClose());
	static int LastExpiry = 0;
	if(ContractType && LastExpiry != ContractExpiry) {
		enterShort();
	   	LastExpiry = ContractExpiry;
	}
}



Any ideas? Unfortunately I can't upload either the t8 or t6 file here
Posted By: jcl

Re: SPY_Options.t8 - 10/09/17 07:28

You can use the dataSaveCSV function for looking in the dataset. It's available in version 1.66 that you can download from this forum. Alternatively, print the selected contract or the whole chain with contractPrint().

The most common problem for generating artificial contracts is some R or RQuantlib installation problem. You see R error messages only on the R console, so the first thing to check is if RQuantlib is working. Call a function from it, like this:

AmericanOption('put', strike=100, volatility=0.4, 100, 0.02, 0.03, 0.5, engine='CrankNicolson')
© 2024 lite-C Forums