Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations
Functions and Operators
The {} below represents placeholders, all expressions are case-insensitive, x represents data time series
abs(x), log(x), sign(x): absolute value, logarithm and sign function respectively.
The following operators +, -, *, /, >, < also conform to their standard meanings, ==: equality check, ||: logical OR, x ? y : z: ternary conditional operator.
rank(x): Cross-sectional ranking, returns the percentile position. Requires a candidate pool of several instruments; with a single instrument nothing can be ranked and the raw value is returned.delay(x, d): Returns the value of series x from d periods ago.sma(x, d): Calculates the simple moving average of series x over d periods.correlation(x, y, d): Calculates the correlation coefficient between time series x and y over the past d periods.covariance(x, y, d): Calculates the covariance between time series x and y over the past d periods.scale(x, a): Normalizes data such thatsum(abs(x))=a(a defaults to 1).delta(x, d): Calculates the current value of time series x minus the value from d periods ago.signedpower(x, a):x^a.decay_linear(x, d): Calculates the d-period weighted moving average of time series x, with weights d,d-1,d-2....1 (normalized).indneutralize(x, g): Industry neutralization based on industry classification g, currently not supported.ts_{O}(x, d): Performs operation O on the past d periods of time series x (O can specifically represent min, max, etc., see below), d will be converted to integer.ts_min(x, d): Minimum value over the past d periods.ts_max(x, d): Maximum value over the past d periods.ts_argmax(x, d): Position ofts_max(x, d).ts_argmin(x, d): Position ofts_min(x, d).ts_rank(x, d): Ranking of time series x over the past d periods (percentile ranking).min(x, d):ts_min(x, d).max(x, d):ts_max(x, d).sum(x, d): Cumulative sum over the past d periods.product(x, d): Cumulative product over the past d periods.stddev(x, d): Standard deviation over the past d periods.