relative: Relative Numeric Representation

View source: R/mltools.R

relativeR Documentation

Relative Numeric Representation

Description

Produce a statistical summary of the latest numeric representation of the ichimoku cloud chart relative to historical values. For determining whether current trading falls within or outside of normal ranges.

Usage

relative(x, order = FALSE, signif = 0.2, quietly)

Arguments

x

an ichimoku object.

order

[default FALSE] set to TRUE to order the results by the absolute 'z-score'.

signif

[default 0.2] set a significance threshold for which if 'p' is equal or lower, the element will be starred with a '*'.

quietly

(optional) if set to TRUE, will suppress printing of additional output to the console and return quietly.

Details

'mean(X)' is the mean value for each element X, 'sd(X)' the standard deviation, and 'X[n]' the nth or latest observed values.

'res' is the residual X[n] - mean(X) and represents a centred measure of deviation for the latest observed value.

The 'z-score' (or standard score) is calculated as res / sd(X) and is a centred and scaled measure of deviation for the latest observed value.

'p >= |z|' represents the empirical probability of the latest observed absolute 'z-score' or greater.

'p*' will display a star if 'p >= |z|' is less than or equal to the value of the argument 'signif'.

'E(|res|)|p' represents the mean or expected absolute value of 'res', conditional upon the absolute 'z-score' being greater than equal to the latest observed absolute 'z-score'.

Value

A data frame containing a statistical summary of the latest ichimoku cloud chart representation in relation to historical values.

In addition, the time index of the latest observed values and total number of datapoints are printed to the console.

Further Details

Please refer to the strategies vignette by calling: vignette("strategies", package = "ichimoku")

Examples

cloud <- ichimoku(sample_ohlc_data, ticker = "TKR")
statistics <- relative(cloud, quietly = TRUE)
relative(cloud, signif = 0.4)
relative(cloud, order = TRUE, signif = 0.4)


ichimoku documentation built on May 23, 2022, 9:05 a.m.