Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, EternallyCurious, 1 invisible), 726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Making dividends myself #486540
09/03/22 21:50
09/03/22 21:50
Joined: Aug 2022
Posts: 65
alun Offline OP
Junior Member
alun  Offline OP
Junior Member

Joined: Aug 2022
Posts: 65
Hello friends,

I have an ETF strategy that I want to test.

ETFs don't have splits only dividends.

I'm using upper/lower channel to rotate between risk/defensive ETFs

1. I want my channels on UNADJUSTED price curve to drive switch decisions

2. I still want to consider dividends in resulting equity and reinvesting

Finally 3. I want to apply my own tax on dividends, say 15%

Is there a good practice of how to achieve this in Zorro?

Thanks!

Re: Making dividends myself [Re: alun] #486544
09/04/22 14:11
09/04/22 14:11
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
For backtesting, use adjusted t6 for asset history, and load unadjusted t6 using the dataset functions as an indicator. (Or merge unadjusted price data into the dataVal column on the adjusted dataset and use that as the history file.)

For live trading, read the equity value supplied by your plugin while using unadjusted data.

Re: Making dividends myself [Re: alun] #486547
09/04/22 20:29
09/04/22 20:29
Joined: Aug 2022
Posts: 65
alun Offline OP
Junior Member
alun  Offline OP
Junior Member

Joined: Aug 2022
Posts: 65
Hi Andrew,

Thanks for your input.

I was thinking about using t6 unadjusted price with fVal column for dividends.

Once I encounter fVal > 0, I need somehow to make an immediate trade maybe with `enterTrade`? to add a profit of `TradeLots * fVal * (1-0.15)`

If use adjusted price there are two issues:
1. I can't deduct taxes from dividends
2. The amount of shares I buy in the past is different (higher) since adjusted price is lower in the past - this means fees are not calculated correctly.

I'll try to work and see if I could tinker something like you did in your article - https://www.vitaltrades.com/2020/07/14/adding-exact-fee-and-credit-calculations-to-zorro/

Thanks for sharing BTW.


Last edited by alun; 09/04/22 20:30.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1