Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some question about the transaction cost code #101

Open
jomeswang opened this issue Apr 18, 2023 · 1 comment
Open

some question about the transaction cost code #101

jomeswang opened this issue Apr 18, 2023 · 1 comment

Comments

@jomeswang
Copy link

jomeswang commented Apr 18, 2023

Hello, I have a question about the transaction cost in this codebase. In the code writing here (https://github.com/Marigold/universal-portfolios/blob/b99bbd3d52361bd4e4c2bec68b53924176ca56d0/universal/result.py#L110), the transaction cost only calculated by the rebalancing portfolio(self.to_rebalance().abs()) and transaction cost rate(self.fee) , it didn't divided by 2.

But in the paper Borodin A, El-Yaniv R, Gogan V. Can we learn to beat the best stock[J]. Advances in Neural Information Processing Systems, 2003, 16. and the paper Huang D, Zhou J, Li B, et al. Robust median reversion strategy for online portfolio selection[J]. IEEE Transactions on Knowledge and Data Engineering, 2016, 28(9): 2480-2493. both indicate a transaction cost formulation like :
image
In the above formulation, we can see that it has a process of dividing by 2, which is doesn't match the code. So I wonder what article the transaction cost code came from.

That's all my question, I will appreciate it if you can reply me.

@Marigold
Copy link
Owner

Hey @jomeswang. I found it more natural to define fees as this. In the paper they probably use "roundtrip" fees which is more common and includes both buy & sell fees. If you use fee = gamma / 2 then you get identical results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants