Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,726
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