Giter Club home page Giter Club logo

Comments (1)

enzbus avatar enzbus commented on July 4, 2024 1

Hello! valid point. The definition of volume in value units I'm using seems a bit arbitrary. The correct one would use the volume-weighted average price (VWAP): the sum, over the period, of each trade in number of shares times its transaction price, divided by the sum over the period of the number of shares traded. Then, ValueVolume = Volume * VWAP. Of course that can't be computed unless one has access to tick data, which is way beyond the level of complexity I'm targeting here. Any other definition like mine or yours is an approximation of the correct one (see, e.g., https://stanford.edu/~boyd/papers/pdf/vwap_opt_exec.pdf ).

I guess my definition has the merit of simplicity since it only uses one element of the open-high-low-close dataframe. (You could as well argue that (Open + Close + High + Low)/4 is a better one.) Also, since in the book we focus on open prices only (in fact, abstracting away the concept of close, high, and low prices) this seems more consistent. In many settings (like continuous markets, take BTC-USD on 1-minute periods) you wouldn't care about close prices in fact, and only need to keep track of one price array and one volume array, both sampled at the start of each period.

However, I promise that by the time we release a stable version, decisions such as this one will be easy to override by defining a different data accessor, without having to patch the source code itself.

from cvxportfolio.

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.