Gamestudio Links
Zorro Links
Newest Posts
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/05/24 16:23
Zorro Trader GPT
by TipmyPip. 10/04/24 19:33
Trading Journey
by firecrest. 10/01/24 10:49
quandl download failed
by 7th_zorro. 09/26/24 17:55
Broker conditions update fails
by AndrewAMD. 09/26/24 15:54
Opinion: lite-C or vsC++
by AndrewAMD. 09/26/24 15:21
download history for multiple stocks??
by walt_Schwarz. 09/18/24 15:38
AUM Magazine
Latest Screens
Zeal-X2
The Bible Game
A psychological thriller game
SHADOW (2014)
Who's Online Now
1 registered members (VoroneTZ), 1,044 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
deobokl, pktr, Gerhard, ClaudiuB, walt_Schwarz
19076 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: 28
V
vicknick Offline OP
Newbie
vicknick  Offline OP
Newbie
V

Joined: Apr 2023
Posts: 28
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: 300
Netherlands
G
Grant Offline
Senior Member
Grant  Offline
Senior Member
G

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

Joined: Apr 2023
Posts: 28
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