Unexpected behaviour with transaction costs

Posted By: JamesHH

Unexpected behaviour with transaction costs - 08/07/19 21:23

I have the line:

Spread = RollLong = RollShort = Commission = Slippage = 0;

in my run() loop, yet when I run this strategy with 4 assets, Zorro is calculating nonzero transaction costs in the results:

Transaction costs -1.26$ spr, 0$ slp, 0$ rol, -1.26$ com

Debugging with printf(...) shows that the Spread is 0 for 2 of the assets, but 0.01 for the other 2. Is this not incorrect behaviour?

When I add

Spread = Commission = 0;

inside the while(loop(Assets)) loop, the transaction costs are then 0, but is that supposed to be necessary?
Posted By: jcl

Re: Unexpected behaviour with transaction costs - 08/08/19 06:48

Definitely.
Posted By: JamesHH

Re: Unexpected behaviour with transaction costs - 08/08/19 17:45

Yeah, that makes sense, that the values are taken from the AssetList file unless specifically overridden.
© 2024 lite-C Forums