This is an old revision of the document!
Function Reference
Fields
Fields are values that can be referenced directly in a script. For example CLOSE (or C in shorthand) represents the closing price of the current bar of the calculation.
| Field | Description |
|---|---|
| OPEN | Opening price |
| HIGH | High Price |
| LOW | Low Price |
| CLOSE | Closing price |
| TYPICAL, TYP | Typical price (OPEN + HIGH + CLOSE) / 3 |
| VOLUME | Volume |
| VOLUMEATBID | Volume that occurred at the bid price. |
| VOLUMEATEOFFER | Volume that occurred at the offer price. |
| TRADES | Number of trades that make up the current bar. |
| TRADESATBID | Number of trades that occurred at the bidprice. |
| TRADESATOFFER | Number of trades that occurred at the offer price. |
| INDEX | Index of the current bar being computed. This runs from 0 to COUNT - 1. |
| COUNT | Number of bars on the chart. |
| BARPERCENT | Percentage completion of the current bar. E.g. 15 minutes into a 1 hour bar would give 0.25 |
| NUMERATOR | The numerator of the market. |
| DENOMINATOR | The denominator of the market. |
| TICKVALUE | The tick value of the market. |
| NIL | Special “non-value” field. |
| MARKETID | The text market id. |
| MARKETDESCRIPTION | The text description of the market. |
Operators
| Arithmetic Operators | |
|---|---|
| Operator | Description |
| + | Add |
| - | Subtract |
| / | Divide |
| * | Multiply |
| % | Modulus |
| Exponent | |
| Relational Operators | |
|---|---|
| Operator | Description |
| =, != | Equals, not equals |
| <, ⇐ | Less than, less than equals |
| >, >= | Greater than, greater than equals |
| Boolean Operators | |
|---|---|
| Operator | Description |
| AND, && | Logical AND |
| OR, | Logical OR |
| XOR | Exclusive OR |
Functions
| Mathematical Functions | |
|---|---|
| Function | Description |
| ABS( <value> ) | Calculates the absolute value of a number. |
| ACCUM( <value> ) | Accumulates (sums) a value over all the data points on the chart. |
| ACOS( <value> ) | Computes the inverse cosine of the value. |
| ASIN( <value> ) | Computes the inverse sin of the value. |
| ATAN( <value> ) | Computes the inverse tan of the value. |
| CASH( <value> ) | Converts the specified tick value to a cash value using the conversion parameters defined for the current market. |
| CASHTICKS( <value> ) | Converts the specified cash value to a tick value using the conversion parameters defined for the current market. |
| CEILING( <value> ) | Computes the nearest larger integer to the value. |
| COS( <value> ) | Computes the cosine of the value. |
| CROSS_ABOVE( <value1>, <value2> ) | Determines when value1 crosses above value2. |
| CROSS_BELOW( <value1>, <value2> ) | Determines when value1 crosses below value2. |
| DISPLAY( <value> ) | Formats the specified tick value to a text representation of the price. |
| EMA( <value> ) | Computes an exponential moving average of the value. |
| FLOOR( <value> ) | Computes the nearest smaller integer to the value. |
| HIGHEST( <value>, <periods> ) | Returns the highest value occurring over the last number of periods from the current data point. |
| INPUT( <value 1>, … <value n> ) | Allows for user input into the script via property pages. |
| LASTVAL( <value>, <periods> ) | Returns the nearest non-Nil value over the last number of periods for the current data point. |
| LWMA( <value> ) | Computes a linear weighted moving average of the value. |
| LN( <value> ) | Computes the natural (base e) logarithm of the value. |
| LOG( <value>, <base> ) | Computes the logarithm of the value in the specified base. |
| LOG10( <value> ) | Computes the base 10 logarithm of the value. |
| LOWEST( <value>, <periods> ) | Returns the lowest value occurring over the last number of periods from the current data point. |
| LSMA( <value> ) | Computes a least square moving average of the value. |
| MAX( <value 1>, … <value n> ) | Returns the largest of the specified values. |
| MIN( <value 1>, … <value n> ) | Returns the smallest of the specified values. |
| MOD( <value 1>, <value 2> ) | Returns the remainder of the division of value 1 by value 2. |
| MOV( <value>, <periods>, <MAType> ) | Computes the moving average of the value over the specified number of periods using the specified moving average type. |
| OFFSET( <value>, <periods> ) | Gets the value offset by the specified number of periods. |
| POW( <value>, <power> ) | Computes the value raised to the specified power. |
| ROC( <value>, <periods> ) | Computes the rate of change of the specified value over the specified number of periods. |
| SIN( <value> ) | Computes the sine of the value. |
| SMA( <value> ) | Computes a simple moving average of the value. |
| SMMA( <value> ) | Computes a smoothed moving average of the value. |
| SQRT( <value> ) | Computes the square root of the value. |
| STDDEV( <value>, <periods> ) | Computes the standard deviation of the value over the specified number of periods. |
| STDDEVP( <value>, <periods> ) | Computes the standard deviation (entire population) of the value over the specified number of periods. |
| SUM( <value>, <periods> ) | Computes the sum of the values over the specified number of periods. |
| SQRT( <value> ) | Calculates the square root of a number. |
| TAN( <value> ) | Calculates the tangent of the value. |
| WILDERMA( <value> ) | Computes a Wells Wilder simple moving average of the value. |
Plotting, Summary and Configuration Functions
| Field | Description |
|---|---|
| PLOT_LINE(...) | Draws a line plot of the value. |
| PLOT_BAND(...) | Draws a line plot of the value with upper and lower bands and option shading between the bands. |
| PLOT_STEP(...) | Draws a step plot of the value. |
| PLOT_POINTS(...) | Draws a point plot of the value. |
| PLOT_RIBBON(...) | Draws a ribbon plot of the value. |
| PLOT_WAVECREST(...) | Draws a wavecrest plot of the value with upper and lower limit lines. Peaks and valleys extending beyond the limit line values are shaded to stand out. |
| PLOT_HISTOGRAM(...) | Draws a histogram (columnar) plot of the value. |
| PLOT_LIMITLINE(...) | Draws a histogram (columnar) plot of the value. |
| PLOT_CENTERLINE(...) | Draws a histogram (columnar) plot of the value. |
| PLOT_RANGEMARKERS(...) | Draws a histogram (columnar) plot of the value. |
| SUMMARY(...) | Displays a summary for the plot. |
Level 1 Headline
| Mathematical Functions | |
|---|---|
| Function | Description |
| ABS( <value> ) | Calculates the absolute value of a number. |
| ACCUM( <value> ) | Accumulates (sums) a value over all the data points on the chart. |
| ACOS( <value> ) | Computes the inverse cosine of the value. |
| ASIN( <value> ) | Computes the inverse sin of the value. |
| ATAN( <value> ) | Computes the inverse tan of the value. |
| CASH( <value> ) | Converts the specified tick value to a cash value using the conversion parameters defined for the current market. |
| CASHTICKS( <value> ) | Converts the specified cash value to a tick value using the conversion parameters defined for the current market. |
| CEILING( <value> ) | Computes the nearest larger integer to the value. |
| COS( <value> ) | Computes the cosine of the value. |
| CROSS_ABOVE( <value1>, <value2> ) | Determines when value1 crosses above value2. |
| CROSS_BELOW( <value1>, <value2> ) | Determines when value1 crosses below value2. |
| DISPLAY( <value> ) | Formats the specified tick value to a text representation of the price. |
| EMA( <value> ) | Computes an exponential moving average of the value. |
| FLOOR( <value> ) | Computes the nearest smaller integer to the value. |
| HIGHEST( <value>, <periods> ) | Returns the highest value occurring over the last number of periods from the current data point. |
| INPUT( <value 1>, … <value n> ) | Allows for user input into the script via property pages. |
| LASTVAL( <value>, <periods> ) | Returns the nearest non-Nil value over the last number of periods for the current data point. |
| LWMA( <value> ) | Computes a linear weighted moving average of the value. |
| LN( <value> ) | Computes the natural (base e) logarithm of the value. |
| LOG( <value>, <base> ) | Computes the logarithm of the value in the specified base. |
| LOG10( <value> ) | Computes the base 10 logarithm of the value. |
| LOWEST( <value>, <periods> ) | Returns the lowest value occurring over the last number of periods from the current data point. |
| LSMA( <value> ) | Computes a least square moving average of the value. |
| MAX( <value 1>, … <value n> ) | Returns the largest of the specified values. |
| MIN( <value 1>, … <value n> ) | Returns the smallest of the specified values. |
| MOD( <value 1>, <value 2> ) | Returns the remainder of the division of value 1 by value 2. |
| MOV( <value>, <periods>, <MAType> ) | Computes the moving average of the value over the specified number of periods using the specified moving average type. |
| OFFSET( <value>, <periods> ) | Gets the value offset by the specified number of periods. |
| POW( <value>, <power> ) | Computes the value raised to the specified power. |
| ROC( <value>, <periods> ) | Computes the rate of change of the specified value over the specified number of periods. |
| SIN( <value> ) | Computes the sine of the value. |
| SMA( <value> ) | Computes a simple moving average of the value. |
| SMMA( <value> ) | Computes a smoothed moving average of the value. |
| SQRT( <value> ) | Computes the square root of the value. |
| STDDEV( <value>, <periods> ) | Computes the standard deviation of the value over the specified number of periods. |
| STDDEVP( <value>, <periods> ) | Computes the standard deviation (entire population) of the value over the specified number of periods. |
| SUM( <value>, <periods> ) | Computes the sum of the values over the specified number of periods. |
| SQRT( <value> ) | Calculates the square root of a number. |
| TAN( <value> ) | Calculates the tangent of the value. |
| WILDERMA( <value> ) | Computes a Wells Wilder simple moving average of the value. |