Skip to main content

Table 14 Operators and functions in the formulaic expressions

From: Detecting the lead–lag effect in stock markets: definition, patterns, and investment strategies

Operator and function

Description

Type

+, −, *, /, ^

Add, subtract, multiply, divide, power

 

\({\rm Correlation}(x, y, n)\)

Correlation of the variables \(x\) and \(y\) for the past \(n\) days

Scalar

\({\rm Covariance}(x, y, n)\)

Covariance of the variables \(x\) and \(y\) for the past \(n\) days

Scalar

\({\rm Delay}(x, n)\)

x value of \(n\) days ago

Scalar

\({\rm Delta}(x, n)\)

x value of current day minus its value of \(n\) days ago

Scalar

\({\rm Rank}(x)\)

Rank value of the variable \(x\) of all the stocks and the achieved rank value is transformed into the range between 0.0 and 1.0. For example, \({\rm Rank}\left([20.2, 15.6, 10.0, 5.7, 50.2, 18.4]\right)\) is [0.8, 0.4, 0.2, 0.0, 1.0, 0.6]

Vector

\({\rm Sign}(x)\)

1 if x > 0, − 1 if x < 0, and 0 if x = 0

Scalar

\({\rm Std}(x, n)\)

Standard deviation of the variable x for the past n days

Scalar

\({\rm Ts}\_{\rm Rank}(x, n)\)

Rank the values of the variable x over the past d days and then all the rank values are transformed into the range between 0.0 and 1.0. Finally, the rank value of the variable x in current day is returned

Scalar

\({\rm Max}(x, n)\)

The maximum value of the variable x over the past d days

Scalar

\({\rm Min}(x, n)\)

The minimum value of the variable x over the past d days

Scalar