Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 927 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
backtest option strategies with quandl FOPs data #470750
02/05/18 13:08
02/05/18 13:08
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
Hi, I want to use Quandl future options data (https://www.quandl.com/data/OWF-OptionWorks-Futures-Options/documentation/methodology) with zorro.

Is this possible with the "S" version to backtest option strategies?

Re: backtest option strategies with quandl FOPs data [Re: jzastrow] #470753
02/05/18 14:01
02/05/18 14:01
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
You can, there's even a three part series on Financial Hacker that walks you through algo trading options using Zorro
http://www.financial-hacker.com/algorithmic-options-trading/

Re: backtest option strategies with quandl FOPs data [Re: Dalla] #470754
02/05/18 15:01
02/05/18 15:01
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
I read about the .t8 files.

Do I have to create those on my own?

Re: backtest option strategies with quandl FOPs data [Re: jzastrow] #470784
02/06/18 15:07
02/06/18 15:07
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes. You can use the dataParse function for this. The format string depends on the source data that you got from an options data provider. After parsing the data, you often need to modify some fields to the format needed in a CONTRACT struct. Here is an example:

Code:
string Extract = "AAPL";
string InName = "NBBO.csv";
string Format = "+,,,%m/%d/%Y,,,i7,f6,s8,,f1,f2,,,f4,f5";
string OutFormat = "%Y-%m-%d,f,f,f,f,f,f,i,i";

void main()
{
	dataNew(1,0,0);
	int Records = dataParse(1,Format,InName,Extract);
	printf("n%d Records parsed",Records);
	for(i=0; i<Records; i++) {
// fix expiry (is stored in wrong order)
		int Expiry = dataInt(1,i,7);
		int MMDD = Expiry/10000;
		int YYYY = Expiry-MMDD*10000;
		dataSet(1,i,7,YYYY*10000+MMDD);
// fix type (is stored as characters 'P' or 'C')
		string Type = dataStr(1,i,8);
		dataSet(1,i,8,ifelse(*Type == 'P',PUT,CALL));
// display progress bar and check [Stop] button
		if(!progress(100*i/Records,0)) break; 
	}
	dataSave(1,strf("History%s.t8",Extract));
}


Re: backtest option strategies with quandl FOPs data [Re: jcl] #470808
02/07/18 12:16
02/07/18 12:16
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
The ZHistory tool does not support t8 files. Is there another tool to verify the file content?

Re: backtest option strategies with quandl FOPs data [Re: jzastrow] #470814
02/07/18 14:40
02/07/18 14:40
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Not yet, but you can save it as CSV, and then open it with a text editor or the ZHistory editor.

For converting a t8 file to CSV:

string InName = "SPY.t8";
string OutName = "SPY.csv";
string Format = "%Y/%m/%d,i7,f6,i8,f1,f2";

void main()
{
dataLoad(1,InName,9);
dataSaveCSV(1,Format,OutName);
}

Re: backtest option strategies with quandl FOPs data [Re: jcl] #470815
02/07/18 14:58
02/07/18 14:58
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
I still have problems understanding Zorro handling futures data and therefore option prices.

assetHistory("SPY",FROM_YAHOO|UNADJUSTED);

At any time different futures are traded in parallel with different expire dates e.g CL18H, CL18J. The assetHistory function seems only to support operating with the "unadjusted continuous contract", where the price data is taken from the current front-contract?!

Re: backtest option strategies with quandl FOPs data [Re: jzastrow] #470816
02/07/18 15:03
02/07/18 15:03
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
assetHistory is for downloading prices. It has nothing to do with option contracts. They are not available for free download. You normally have to buy them.

Re: backtest option strategies with quandl FOPs data [Re: jcl] #470822
02/07/18 16:57
02/07/18 16:57
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
Following the options example the history data of the underlying
are only used to have a timeframe to loop over?

Re: backtest option strategies with quandl FOPs data [Re: jzastrow] #470823
02/07/18 17:00
02/07/18 17:00
Joined: Feb 2018
Posts: 15
J
jzastrow Offline OP
Newbie
jzastrow  Offline OP
Newbie
J

Joined: Feb 2018
Posts: 15
I’m creating the t8 files from the Quandl Optionworks data.
Also subscribed to Zorro S

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1