Giter Club home page Giter Club logo

Comments (4)

andreas-vester avatar andreas-vester commented on June 22, 2024 1

@polakowo

Thus, you short buy slightly more than you can afford

I don't fully understand this. Do you mind to elaborate?

Still, no matter how you treat fees/slippage in the first place, I feel that long_only and short_only returns should add up to both returns.

Coming back to my example above (periods marked in yellow in the second dataframe), if I am only invested on the short_only side, the return in these specific periods will solely be responsible for the overall (both) portfolio return, won't it?

If my only portfolio position is to be short one asset and this asset looses 5% in a single period, then I expect my return on the short_only side to be +5%. As this is my only position, the portfolio return should be equally +5%, shouldn't it?

from vectorbt.

polakowo avatar polakowo commented on June 22, 2024

Fees and slippage aren't taken into account when target percentage is translated into number of shares in order to satisfy the 100% portfolio value requirement. Thus, you short buy slightly more than you can afford (you can see this when you print the allocation with pf.asset_value() / pf.value()).

from vectorbt.

andreas-vester avatar andreas-vester commented on June 22, 2024

@polakowo Any thoughts?

from vectorbt.

xiandong79 avatar xiandong79 commented on June 22, 2024

@polakowo is this a bug?

from vectorbt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.