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
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (howardR, 7th_zorro), 893 guests, and 2 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
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,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
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