The analysis formula refers to the market quote calculation method in the public `alpha101`

of `worldquant`

: http://q.fmz.com/chart/doc/101_Formulaic_Alphas.pdf, which is basically compatible with its grammar (with explanations for unimplemented features), and has been enhanced. It is used for quickly performing calculations on time series and validating ideas, Alpha Factor Analysis Tool page.

**"{}" below represents placeholder, all expressions are not case sensitive, and “x” represents data time series**

`abs(x), log(x), sign(x)`

literally means absolute value, logarithm and sign function, respectively.

The following operators, including `+, -, *, /, >, <`

, also meet the meanings of their standards; `==`

represents “equal or not”; `||`

means “or”; `x? y: z`

indicates ternary operator.

`rank(x)`

: the ranking of cross-sections, returning the percentage of the location; it is necessary to specify multiple candidate target pools, which cannot be calculated for a single market and will directly return the original result.`delay(x, d)`

: the value before the d period of the sequence.`sma(x, d)`

: the simple moving average of the d period of the sequence.`correlation(x, y, d)`

: the correlation coefficient of time series x and y over the past d periods.`covariance(x, y, d)`

: the covariance of the time series x and y in the past d periods.`scale(x, a)`

: it normalizes the data, so that`sum(abs(x)) = a`

(“a” defaults to 1).`delta(x, d)`

: the current value of the time series x minus the value before d periods.`signedpower(x, a)`

:`x^a`

.`decay_linear(x, d)`

: weighted d-period moving average of time series x, with weights being d, d-1, d-2… 1 (normalized).`indneutralize(x, g)`

: the neutral processing for industry classification “g”, currently not supported.`ts_{O}(x, d)`

: perform “O” operations on the time series x in the past d periods (“O” can specifically represent “min” and “max”, etc., introduced later), “d” will be converted to an integer.`ts_min(x, d)`

: the minimum value of the past d periods.`ts_max(x, d)`

: the maximum value of the past d periods.`ts_argmax(x, d)`

:`ts_max(x, d)`

position.`ts_argmin(x, d)`

:`ts_min(x, d)`

position.`ts_rank(x, d)`

: sorting of the past d periods time series x values (percentage sorting).`min(x, d)`

:`ts_min(x, d)`

.`max(x, d)`

:`ts_max(x, d)`

.`sum(x, d)`

: the sum of the past d periods.`product(x, d)`

: the product of the past d periods.`stddev(x, d)`

: the standard deviation of the past d periods.

**The input data is not case sensitive; the default data is the selected symbol on the web page, or it can be specified directly, such as binance.ada_bnb**

`returns`

: returns of closing price.`open, close, high, low, volume`

: namely open price, close price, highest price, lowest price and trading volume during the period.`vwap`

: volume-weighted executed price, not implemented yet, which is currently the closing price.`cap`

: total market value, not implemented yet.`IndClass`

: industry classification, not implemented yet.

Outputting multiple results (expressed by list) at once is supported; for example, `[sma(close, 10), sma(high, 30)]`

will draw two lines on the chart. In addition to inputting time series data, it can also be used as a simple calculator.