2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Interest on leverage for Z8 and Z9
[Re: jcl]
#469845
12/11/17 12:31
12/11/17 12:31
|
Joined: Dec 2017
Posts: 129 Halifax, NS
kujo
OP
Member
|
OP
Member
Joined: Dec 2017
Posts: 129
Halifax, NS
|
Just calculate the rollover as in the example. What exactly is the problem? Jcl, thanks for helping out. The problem is that I want to calculate the cost of borrowing for leverage in the stock market with Zorro (Z9 system to be exact). Example: I have 5k in my account. I use leverage 2 and borrow another 5k from the broker. Then I buy 10k worth of ETFs. I remain open in this position for a year. Interest on borrowing money from the broker is 3%. By the end of the year I owe broker ~150 (5k * 3%) as an interest for borrowing. So, I want Zorro to calculate this amount. I understand what is rollover for forex, but it's not clear for me what is rollover for the stock market in Zorro. As I understand, I can use RollLong to calculate the interest for borrowing. However, rolllong costs calculated by Zorro in the above case would be ~300, because Zorro will use 10k for calculation. So, rolllong isn't exactly the cost of borrowing. I wonder if I can calculate the cost of borrowing (150 in the above case) for the stock market. If yes, could you please point out how to do this using Z9 system? Thank you!
|
|
|
Re: Interest on leverage for Z8 and Z9
[Re: kujo]
#469849
12/11/17 13:35
12/11/17 13:35
|
Joined: Sep 2017
Posts: 235
Hredot
Member
|
Member
Joined: Sep 2017
Posts: 235
|
Just my two cents:
Certainly you do not intend to use up all available funds in your account to buy assets? It is essential to leave a buffer to allow for price fluctuations and avoid a margin call.
You can manually adjust the rolllong parameter until it accumulates to the figure you expect over a year. In your leverage 2 example, just divide rollong by two.
Last edited by Hredot; 12/11/17 13:37.
|
|
|
Re: Interest on leverage for Z8 and Z9
[Re: Hredot]
#469855
12/11/17 16:48
12/11/17 16:48
|
Joined: Dec 2017
Posts: 129 Halifax, NS
kujo
OP
Member
|
OP
Member
Joined: Dec 2017
Posts: 129
Halifax, NS
|
Thanks for the comments!
So, as I understand so far, there is no dedicated function in Zorro to calculate a margin interest for borrowed money (cost of borrowing) in case of leverage in the stock market. RollLong calculates rollover costs and it's not really a margin interest. It calculates costs for holding all positions overnight, not a cost of interest for borrowed money. As a workaround, it's possible to use RollLong and multiply it by (1 - 1 / leverage) , as Hredot suggested (0.5 in case of leverage 2, thanks for idea!). But it seems that this method will give only approximate results because there are some assumptions.
So, I have 3 questions: 1. jcl, could you confirm or deny that the best way to calculate margin interest (or cost of borrowing) for the stock market is: "RollLong * (1 - 1 / leverage)"? RollLong comes from broker's interest for borrowing, i.e. 3%. (1 - 1 / leverage) takes into account only borrowed amount, not all (i.e. 1/2 for lev 2; 2/3 for lev 3, etc ). 2. Are there any plans to implement a dedicated function for margin interest (cost of borrowing) calculation? if not, why? 3. I assume I can manually calculate margin interest (cost of borrowing) in my own written scripts. If so, could you please give me a hint how to do this?
Thanks for the help!
Last edited by kujo; 12/12/17 01:51.
|
|
|
Re: Interest on leverage for Z8 and Z9
[Re: jcl]
#469880
12/12/17 15:01
12/12/17 15:01
|
Joined: Dec 2017
Posts: 129 Halifax, NS
kujo
OP
Member
|
OP
Member
Joined: Dec 2017
Posts: 129
Halifax, NS
|
I'm afraid I do not really understand your problem. When you have open positions, you borrow margin and pay interest. That is the rollover. It has nothing to do with stock or forex. Forex is only a special case as you trade pairs, so rollover is here the interest difference.
Just enter the Rollover in the asset list as in the example that I gave. It is daily interest*price*(1-1/leverage). If you want it to be very precise, you can really calculate rollover in the script once per day, but then you need to know the broker's current interest. Oh, it seems that finally comprehension arrived to me... :-) Because of this part (1-1/leverage) the interest will be calculated only for borrowed amount, not for all. Well, thanks for your help and patience! I also found this phrase in the manual: If the Rollover is unknown, it can be estimated from the current annual interest divided by 365 and multiplied with asset price/leverage.I believe instead of price / leverage it should be price * (1 - 1/leverage). Correct me please if I am wrong.
|
|
|
|