Skip to contents

The trading_volume() is a generic S3 function that builds upon 'type-safe'-esque workflows limited to classes in in base R, and the package-wide dependencies. Ie. class in, class out. Each method is a soft wrapper of model.frame and therefore the OHLC-V series must be coercible to a data.frame.

trading_volume() also accepts a double vector in which case the indicator is calculated 'as-is' without passing through model.frame. trading_volume() returns an n by k matrix computed in C by default. When k = 1, the result is simplified to a double vector; for k > 1, the full n by k matrix is returned.

Usage

trading_volume(x, cols, ma, ...)

Arguments

x

An OHLC-V series that is coercible to data.frame. Alternatively, x may also be supplied as a double vector.

cols

(formula). An optional 1 variable formula passed into model.frame. Internally uses ~volume by default.

ma

An optional list of moving average specifications.

...

Additional parameters passed into model.frame

Author

Serkan Korkmaz