Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Interest on leverage for Z8 and Z9 #469719
12/04/17 14:49
12/04/17 14:49
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Hello,
Z8 and Z9 systems use leverage 2:1. I am trying to understand whether a backtest takes into account interest on leverage that should be paid to a broker. As I understand, it should decrease the returns.
Thanks!

Re: Interest on leverage for Z8 and Z9 [Re: kujo] #469738
12/05/17 14:34
12/05/17 14:34
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, when you know the interest per day and contract. Enter it in the RollLong column of the AssetsZ8/Z9 asset list. F.i. for a $50 stock with 1% annual interest and a USD account, enter -0.0009 in that column.

Re: Interest on leverage for Z8 and Z9 [Re: jcl] #469743
12/05/17 16:38
12/05/17 16:38
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
How do you arrive at -0.0009?

My calculation gives:
-$50/100/240=-$0.0021
rollover per business day.

Last edited by Hredot; 12/05/17 16:39.
Re: Interest on leverage for Z8 and Z9 [Re: Hredot] #469749
12/06/17 10:26
12/06/17 10:26
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
In fact it's -0.0007, since calendar days are counted, not business days. -$50 / leverage 2 / 365 days * 0.01 interest = -0.0007.

Re: Interest on leverage for Z8 and Z9 [Re: jcl] #469753
12/06/17 14:46
12/06/17 14:46
Joined: Sep 2017
Posts: 235
H
Hredot Offline
Member
Hredot  Offline
Member
H

Joined: Sep 2017
Posts: 235
Thanks for your reply!

Does this mean Zorro continuously executes the run() routine on weekends as well?

Re: Interest on leverage for Z8 and Z9 [Re: Hredot] #469755
12/06/17 16:14
12/06/17 16:14
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
No, rollover is unrelated to the run() function.

Re: Interest on leverage for Z8 and Z9 [Re: jcl] #469757
12/06/17 16:45
12/06/17 16:45
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Originally Posted By: jcl
In fact it's -0.0007, since calendar days are counted, not business days. -$50 / leverage 2 / 365 days * 0.01 interest = -0.0007.

thanks for clarification! As I understand, it's initial RollLong value. When I test a system will this value be recalculated every day based on a current stock price?

Last edited by kujo; 12/06/17 16:49.
Re: Interest on leverage for Z8 and Z9 [Re: kujo] #469760
12/06/17 19:21
12/06/17 19:21
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Also, I have a question about MarginCost and Leverage in AssetsZ9.csv
1st test: MarginCost=0 and Leverage=2.
According to the manual MarginCost can be left at 0 when Leverage is used for determining the margin. Ok

2nd test: MarginCost=25 and Leverage=0.
Again, according to the manual when MarginCost is nonzero, Leverage is ignored and the Leverage variable is calculated from MarginCost and the initial price.

Initial price = 50, PIP = PIPCost = 0.01
As I understands, these tests are equal and should produce the same results. However, they are different. Is it a bug or I miss something?

Last edited by kujo; 12/06/17 19:22.
Re: Interest on leverage for Z8 and Z9 [Re: kujo] #469770
12/07/17 15:55
12/07/17 15:55
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Rollover will not be recalculated, since it changes anyway all the time unrelated to the asset price. MarginCost is calculated from the current price when Leverage is set, otherwise it is taken from the asset list. So your 2 settings are in fact different.

Re: Interest on leverage for Z8 and Z9 [Re: jcl] #469823
12/10/17 03:38
12/10/17 03:38
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Originally Posted By: jcl
Yes, when you know the interest per day and contract. Enter it in the RollLong column of the AssetsZ8/Z9 asset list. F.i. for a $50 stock with 1% annual interest and a USD account, enter -0.0009 in that column.


Maybe I'm missing something, but, as I understand, the RollOver cost model came from Forex. It's not really applicable to stock market. In stock market there is no overnight fee. However, there is an interest that should be paid to a broker for borrowing money (in case of leverage) or securities (in case of short selling).

So for the Z9 strategy that trades ETFs, if I enter interest in the RollLong column and leverage = 2, Zorro calculates interest fee for every security that I hold overnight. But the interest is only applicable for the borrowed money/securities.

Could you please comment on this? How to tailor Z9 strategy's cost model for real stocks/ETFs?
Thank you!


Last edited by kujo; 12/10/17 04:06.
Page 1 of 3 1 2 3

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1