Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 21,112 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 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