Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,621 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Altering Workshop script for shorter time frame #484790
12/09/21 18:42
12/09/21 18:42
Joined: Sep 2021
Posts: 9
Waikato
T
TimExcellent Offline OP
Newbie
TimExcellent  Offline OP
Newbie
T

Joined: Sep 2021
Posts: 9
Waikato
Hi,

I'm trying to alter presumably quite an old script that is also in the Blackbook for options trading and also trying to figure out how to change this simple script to trade a much shorter time frame using some 1 minute options data I have. How should the identifier/pointer for the SPX history be formatted in this case and error in the script? My simple thinking was that Zorro should be able to see "*.t8" files and then the Asset pointer being SPX it should see the files (hopefully should also see the screenshot attached):


Code
// Workshop 8: Simple Option system //////////////////////////////////////////
#include <contract.c>

#define PREMIUM	3.00


void run() 
{
	StartDate = 20210104;
	EndDate = 20210110;
	BarPeriod = 1;
	set(PLOTNOW,LOGFILE);

	History = "*.t8"; // options data for price history
	assetList("AssetsTS");
	asset("SPX");
	Multiplier = 100;

// load today's contract chain
	if(!contractUpdate(Asset,0,CALL|PUT)) return;

// Enter new positions
	if(!NumOpenShort && !is(LOOKBACK)) { 
		if(combo(
			contractFind(CALL,2,PREMIUM,2),1, 
			contractFind(PUT,2,PREMIUM,2),1,
			0,0,0,0)) 
		{
			MarginCost = comboMargin(-1,3);
			enterShort(comboLeg(1));
			enterShort(comboLeg(2));
		}
	}
}

Attached Files Zorro Screenshot 2021-12-09 133041.png
Re: Altering Workshop script for shorter time frame [Re: TimExcellent] #484791
12/09/21 19:54
12/09/21 19:54
Joined: Feb 2017
Posts: 1,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
Chicago
Zorro only supports the t8 file format ASSETNAME_YYYY.t8 for intraday history t8 files. For your filename convention, you need to manually load t8 datasets and feed it into the contract functions.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1