Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Using Option Chains at 1 Minute Intervals #483086
05/03/21 04:00
05/03/21 04:00
Joined: May 2021
Posts: 1
R
Robert_ Offline OP
Guest
Robert_  Offline OP
Guest
R

Joined: May 2021
Posts: 1
Zorro does support option strategies, and can read historical option data from sources such as IVolatility.

It seems that for options Zorro may select the option data file based on date only, assuming that the option file contains EOD option data for that day only.

So if you are working on an intraday option strategy, and option data from IVolatility, which contains the options chains at each minute of the day, how do you select the correct option change at the time of the current bar ? It's not entirely clear how "Asset" function can select the correct data for a given bar that is being processed.

If anyone has done this before, any guidance would be appreciated.

Re: Using Option Chains at 1 Minute Intervals [Re: Robert_] #483091
05/03/21 21:35
05/03/21 21:35
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
The tutorial has an options strategy where you can see how it works. But for using 1 minute options data you must obviously set the bar period also to 1 minute.

Re: Using Option Chains at 1 Minute Intervals [Re: Robert_] #483099
05/04/21 05:28
05/04/21 05:28
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
There are some subtle differences when you use 1 minute data, for instance you must then update the contracts differently in backtest and in live trading.

In backtest the options chain has also the prices, so load it at any bar. But live it loads no prices but can take up to 10 minutes, so better load it live only once per day.

Re: Using Option Chains at 1 Minute Intervals [Re: Petra] #483101
05/04/21 07:46
05/04/21 07:46
Joined: Jan 2021
Posts: 9
P
pieran Offline
Newbie
pieran  Offline
Newbie
P

Joined: Jan 2021
Posts: 9
Is there a descripttion in the manual for these subtle differences? I did not find these.
At the moment I am struggeling at importing IVolatility one minute data. I am using the sample file they are providing, but the CSV to Options script seems to have a problem with the import format:

// 2019-10-29 09:30:00,9327,SPX,2019-10-30,1800,C,E,SPXW 191030C01800000,1234.1,1237.3,2019-10-29 09:11:36,2019-10-29 09:11:36,7,7,W,W,0,0.3538,3034.4788,0.99993,0,0,0,0.0632,-1,0,2019-10-29 09:27:37,2019-10-29 09:30:00
string Format = "%Y-%m-&d %H:%M:%S,,,i,f,s,s,,f,f,,,i,i,,,i,,f"; // from the sample above

Last edited by pieran; 05/04/21 07:46.
Re: Using Option Chains at 1 Minute Intervals [Re: Robert_] #483103
05/04/21 08:11
05/04/21 08:11
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
For backtesting you need not care about subtle differences. But when live trading you should know how long it takes to download the contract chain from your broker. If longer than one bar period, you can obviously not load it at any bar and must load it less frequently. Preferably once per day and outside market hours. If you have problems, we have a service for programming your options strategy.

The ivolatility option formats are very different and change all the time, so you must normally adapt the code to the format of your data. We also have a service for that.


Re: Using Option Chains at 1 Minute Intervals [Re: Petra] #483247
05/12/21 15:08
05/12/21 15:08
Joined: Jan 2021
Posts: 9
P
pieran Offline
Newbie
pieran  Offline
Newbie
P

Joined: Jan 2021
Posts: 9
I managed to adjust the import script but due to the size I run into the next problem.
Is there a way to store the .t8 data in e.g. daily files?

To put options data for a whole year is way to much data for the 32bit memory limit. Could history files named other than ASSET_YEAR.t8 ?
Unfortunately, I did not find anything in the manual.

Can multiple .t8 file be concatinated?

Re: Using Option Chains at 1 Minute Intervals [Re: Robert_] #483248
05/12/21 15:55
05/12/21 15:55
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Yes. A t8 file consists of nothing more than an array of CONTRACT structs, so you can assemble that as you please into an ASSET.t8 file. The dataset functions, file functions, and time functions included with Zorro make this easy.

Re: Using Option Chains at 1 Minute Intervals [Re: AndrewAMD] #483249
05/12/21 17:10
05/12/21 17:10
Joined: Jan 2021
Posts: 9
P
pieran Offline
Newbie
pieran  Offline
Newbie
P

Joined: Jan 2021
Posts: 9
Yes, but the problem is, that the options data of one year exceeds the memory limit.

So my question is, can I use history files that are organized like this:

SPX_2019-01-01.t8
SPX_2019-01-02.t8
.
.


When I try it, Zorro tells me it does not find SPX.t8. At the moment I am trying to play with the "History" Variable and set it to the appropriate file for every day but this did not succeed yet:

History = strf("*_%s.t8", strdate("%Y-%m-%d",ldate(ET,0)));

My filenames are:
SPX_2019-08-01.t8
SPX_2019-08-02.t8
.
.


Any other thoughts? If this is not possible, does it mean you can only backtest option strategies when the data of one year does not exceed around 3 GB?

Re: Using Option Chains at 1 Minute Intervals [Re: Robert_] #483250
05/12/21 17:15
05/12/21 17:15
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Again, yes.

Load one day file at a time into data set A. Process it into daily data. Append it to data set B. Clear data set A and repeat for the next day, and so on, until data set B has all of the days.

This can all be done within a 32-bit footprint.

Re: Using Option Chains at 1 Minute Intervals [Re: AndrewAMD] #483251
05/12/21 17:29
05/12/21 17:29
Joined: Jan 2021
Posts: 9
P
pieran Offline
Newbie
pieran  Offline
Newbie
P

Joined: Jan 2021
Posts: 9
ok, so if I read each day separately (A) and append it to (B) by using "dataAppend", I will have a .t8 file on disk which is lets say 100 GB for one year.
When I use this file for backtesting, than the memory limitation does not come into play?

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1