MyNixOS website logo
Description

Portfolio Management with R.

Tools for the practical management of financial portfolios: backtesting investment and trading strategies, computing profit/loss and returns, analysing trades, handling lists of transactions, reporting, and more. The package provides a small set of reliable, efficient and convenient tools for processing and analysing trade/portfolio data. The Manual provides all the details; it is available from <https://enricoschumann.net/R/packages/PMwR/manual/PMwR.html>. Examples and descriptions of new features are provided at <https://enricoschumann.net/notes/PMwR/>.

Portfolio Management with R

CRAN_Status_Badge CRAN RStudio mirror downloads

About PMwR

Functions for the practical management of financial portfolios: backtesting investment and trading strategies, computing profit-and-loss and returns, analysing trades, reporting, and more. PMwR provides a small set of reliable, efficient and convenient tools that help in processing and analysing trade/portfolio data. The package does not provide a complete application that could be used 'as is', but building blocks for creating such an application.

PMwR grew out of various pieces of software that I have written since 2008. The package has become fairly stable in recent years, though still not fully stable (e.g., argument names might still be made consistent across functions); in some cases, generic functions might be introduced. The recommendedpractice is therefore to explicitlynameargumentsinfunctioncalls (and not pass arguments by position). Any changes in argument names will be documented in the NEWS file and so can be followed easily. More details are in the ChangeLog.

What PMwR provides

The package provides functions that can serve as building blocks for many activities in portfolio management.

  • Keeping track of transactions: The package provides functions for handling journals (sometimes called blotters). See ?journal and ?position.
  • Testing strategies: See ?btest (and this tutorial on backtesting).
  • Computing profit/loss and returns: See ?returns, ?rc, ?pl or ?unit_prices.

All details are in the manual. New features are often described in these notes.

I am grateful for comments, suggestions and corrections; bug reports, in particular, can be started directly from within R:

library("utils")
bug.report("[PMwR] Unexpected behaviour in function XXX",
           address = maintainer("PMwR"),
           package = "PMwR")

Installation

The latest stable version of the package is available from CRAN. The latest development version is available from https://enricoschumann.net/R/packages/PMwR/. You can install either version directly from within R:

install.packages('PMwR') ## CRAN stable version

install.packages('PMwR', ## development version
                 repos = c('https://enricoschumann.net/R',
                           getOption('repos')))

The package depends on several other packages, which can be obtained from the same repository and from CRAN.

There are also publicly-available repositories at https://git.sr.ht/~enricoschumann/PMwR , https://gitlab.com/enricoschumann/PMwR and https://github.com/enricoschumann/PMwR.

Metadata

Version

0.19-5

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows