Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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: 22
V
vicknick Offline OP
Newbie
vicknick  Offline OP
Newbie
V

Joined: Apr 2023
Posts: 22
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: 296
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 296
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: 22
V
vicknick Offline OP
Newbie
vicknick  Offline OP
Newbie
V

Joined: Apr 2023
Posts: 22
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: 785
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 785
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