Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
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
2 registered members (TipmyPip, AndrewAMD), 16,415 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
Zorro Calculate Commission and Spread Even Setting Is Off #488249
05/13/24 09:17
05/13/24 09:17
Joined: Apr 2023
Posts: 60
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 60
I have set Spread and Commission to zero when running a script that trades a portfolio of assets.

But from the performance report, it seems Zorro still run the trades with spread and commission. Below is the script and performance report.

Code
function run() 
{
	set(LOGFILE);
	StartDate = 1985;
	LookBack = 105;
	Capital = 1000000;
	Spread = Commission = 0;
	RollLong = RollShort = Slippage = Penalty = 0;
	
	//Loop through different instruments
	while(asset(loop("ZCeod","NGeod","EURUSDeod","HEeod","PLeod")))
	{
	// code here...
	}
}


Code
Test Strategy-Portfolio , Zorro 2.606

Transaction costs   -326180$ spr, 0$ slp, -92948$ rol, -178320$ com
Capital required    213741$


Is there a way to set spread and commission to zero, and only runs it when needed? Thanks.

Last edited by vicknick; 05/13/24 09:18.
Re: Zorro Calculate Commission and Spread Even Setting Is Off [Re: vicknick] #488250
05/14/24 10:16
05/14/24 10:16
Joined: Aug 2017
Posts: 311
Netherlands
G
Grant Offline
Senior Member
Grant  Offline
Senior Member
G

Joined: Aug 2017
Posts: 311
Netherlands
Did you checked your asset list?

https://zorro-project.com/manual/en/account.htm

Re: Zorro Calculate Commission and Spread Even Setting Is Off [Re: Grant] #488251
05/16/24 06:31
05/16/24 06:31
Joined: Apr 2023
Posts: 60
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 60
Yes, the asset list has the spread and commission entered. But I would like to turn off them for this script, that's why I added Spread = Commission = 0 in the script.

However from the performance report, it seems that they are still included.

Re: Zorro Calculate Commission and Spread Even Setting Is Off [Re: vicknick] #488252
05/16/24 10:41
05/16/24 10:41
Joined: Jul 2017
Posts: 787
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 787
Those variables are asset-specific; so, you need to set them after an asset() call. (i.e. in your case - in the body of the loop)


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1