====== 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 ^
| [[desktop:desktop_chart_scripting_function_reference_open|OPEN]] | Opening price|
| [[desktop:desktop_chart_scripting_function_reference_high|HIGH]] | High Price |
| [[desktop:desktop_chart_scripting_function_reference_low|LOW]] | Low Price |
| [[desktop:desktop_chart_scripting_function_reference_close|CLOSE]] | Closing price |
| [[desktop:desktop_chart_scripting_function_reference_typical|TYPICAL]], [[desktop:desktop_chart_scripting_function_reference_typ|TYP]] | Typical price (OPEN + HIGH + CLOSE) / 3 |
| [[desktop:desktop_chart_scripting_function_reference_volume|VOLUME]] | Volume |
| [[desktop:desktop_chart_scripting_function_reference_volumeatbid|VOLUMEATBID]] | Volume that occurred at the bid price. |
| [[desktop:desktop_chart_scripting_function_reference_volumeatoffer|VOLUMEATEOFFER]] | Volume that occurred at the offer price. |
| [[desktop:desktop_chart_scripting_function_reference_trades|TRADES]]| Number of trades that make up the current bar. |
| [[desktop:desktop_chart_scripting_function_reference_tradesatbid|TRADESATBID]]| Number of trades that occurred at the bidprice. |
| [[desktop:desktop_chart_scripting_function_reference_tradesatoffer|TRADESATOFFER]] | Number of trades that occurred at the offer price. |
| [[desktop:desktop_chart_scripting_function_reference_index|INDEX]] | Index of the current bar being computed. This runs from 0 to COUNT - 1. |
| [[desktop:desktop_chart_scripting_function_reference_count|COUNT]] | Number of bars on the chart. |
| [[desktop:desktop_chart_scripting_function_reference_barpercent|BARPERCENT]] | Percentage completion of the current bar. E.g. 15 minutes into a 1 hour bar would give 0.25 |
| [[desktop:desktop_chart_scripting_function_reference_numerator|NUMERATOR]] | The numerator of the market.|
| [[desktop:desktop_chart_scripting_function_reference_demoninator|DENOMINATOR]] | The denominator of the market.|
| [[desktop:desktop_chart_scripting_function_reference_tickvalue|TICKVALUE]] | The tick value of the market. |
| [[desktop:desktop_chart_scripting_function_reference_nil|NIL]] | Special "non-value" field. |
| [[desktop:desktop_chart_scripting_function_reference_marketid|MARKETID]]| The text market id. |
| [[desktop:desktop_chart_scripting_function_reference_marketdescription|MARKETDESCRIPTION]] | The text description of the market. |
----
====== Operators ======
----
^ Arithmetic Operators ^^
^ Operator ^ Description^
| + | Add |
| - | Subtract |
| / | Divide |
| * | Multiply |
| %| Modulus |
|{{glyphicon>chevron-up}}|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,{{glyphicon>pause}} | Logical OR |
| XOR | Exclusive OR |
----
====== Functions ======
----
^Mathematical Functions^^
^ Function ^ Description ^
|[[desktop:desktop_chart_scripting_function_reference_ABS( )|ABS( )]]| Calculates the absolute value of a number.|
|[[desktop:desktop_chart_scripting_function_reference_ACCUM( )|ACCUM( )]]| Accumulates (sums) a value over all the data points on the chart.|
|[[desktop:desktop_chart_scripting_function_reference_ACOS( )|ACOS( )]]| Computes the inverse cosine of the value.|
|[[desktop:desktop_chart_scripting_function_reference_ASIN( )|ASIN( )]]| Computes the inverse sin of the value.|
|[[desktop:desktop_chart_scripting_function_reference_ATAN( )|ATAN( )]]| Computes the inverse tan of the value.|
|[[desktop:desktop_chart_scripting_function_reference_CASH( )|CASH( )]]| Converts the specified tick value to a cash value using the conversion parameters defined for the current market.|
|[[desktop:desktop_chart_scripting_function_referenceCASHTICKS( )|CASHTICKS( )]]|Converts the specified cash value to a tick value using the conversion parameters defined for the current market.|
|[[desktop:desktop_chart_scripting_function_referenceCEILING( )|CEILING( )]]| Computes the nearest larger integer to the value.|
|[[desktop:desktop_chart_scripting_function_reference_COS( )|COS( )]]| Computes the cosine of the value.|
|[[desktop:desktop_chart_scripting_function_reference_CROSS_ABOVE( , )|CROSS_ABOVE( , )]]| Determines when value1 crosses above value2.|
|[[desktop:desktop_chart_scripting_function_reference_CROSS_BELOW( , )|CROSS_BELOW( , )]]| Determines when value1 crosses below value2.|
|[[desktop:desktop_chart_scripting_function_reference_DISPLAY( )|DISPLAY( )]]| Formats the specified tick value to a text representation of the price.|
|[[desktop:desktop_chart_scripting_function_reference_EMA( )|EMA( )]]| Computes an exponential moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_FLOOR( )|FLOOR( )]]| Computes the nearest smaller integer to the value.|
|[[desktop:desktop_chart_scripting_function_reference_HIGHEST( , )|HIGHEST( , )]]|Returns the highest value occurring over the last number of periods from the current data point.|
|[[desktop:desktop_chart_scripting_function_reference_INPUT( , ... )|INPUT( , ... )]]| Allows for user input into the script via property pages.|
|[[desktop:desktop_chart_scripting_function_reference_HMA( )|HMA( )]]| Computes a hull moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_LASTVAL( , )|LASTVAL( , )]]|Returns the nearest non-Nil value over the last number of periods for the current data point.|
|[[desktop:desktop_chart_scripting_function_reference_LWMA( )|LWMA( )]]|Computes a linear weighted moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_LN( )|LN( )]]|Computes the natural (base e) logarithm of the value.|
|[[desktop:desktop_chart_scripting_function_reference_Log( )|LOG( , )]]|Computes the logarithm of the value in the specified base.|
|[[desktop:desktop_chart_scripting_function_reference_LOG10( )|LOG10( )]]|Computes the base 10 logarithm of the value.|
|[[desktop:desktop_chart_scripting_function_reference_LOWEST( , )|LOWEST( , )]]|Returns the lowest value occurring over the last number of periods from the current data point.|
|[[desktop:desktop_chart_scripting_function_reference_LSMA( )|LSMA( )]]|Computes a least square moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_MAX( , ... )|MAX( , ... )]]| Returns the largest of the specified values.|
|[[desktop:desktop_chart_scripting_function_reference_MIN( , ... )|MIN( , ... )]]| Returns the smallest of the specified values.|
|[[desktop:desktop_chart_scripting_function_reference_MOD( , )|MOD( , )]]|Returns the remainder of the division of value 1 by value 2.|
|[[desktop:desktop_chart_scripting_function_reference_MOV( , , )|MOV( , , )]]|Computes the moving average of the value over the specified number of periods using the specified moving average type.|
|[[desktop:desktop_chart_scripting_function_reference_OFFSET( , )|OFFSET( , )]]|Gets the value offset by the specified number of periods.|
|[[desktop:desktop_chart_scripting_function_reference_POW( , )|POW( , )]]|Computes the value raised to the specified power.|
|[[desktop:desktop_chart_scripting_function_reference_ROC( , )|ROC( , )]]| Computes the rate of change of the specified value over the specified number of periods.|
|[[desktop:desktop_chart_scripting_function_reference_SIN( )|SIN( )]] |Computes the sine of the value.|
|[[desktop:desktop_chart_scripting_function_reference_SMA( )|SMA( )]]|Computes a simple moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_SMMA( )|SMMA( )]]|Computes a smoothed moving average of the value.|
|[[desktop:desktop_chart_scripting_function_reference_SQRT( )|SQRT( )]]|Computes the square root of the value.|
|[[desktop:desktop_chart_scripting_function_reference_STDDEV( , )|STDDEV( , )]]|Computes the standard deviation of the value over the specified number of periods.|
|[[desktop:desktop_chart_scripting_function_reference_STDDEVP( , )|STDDEVP( , )]]|Computes the standard deviation (entire population) of the value over the specified number of periods.|
|[[desktop:desktop_chart_scripting_function_reference_SUM( , )|SUM( , )]]|Computes the sum of the values over the specified number of periods.|
|[[desktop:desktop_chart_scripting_function_reference_SQRT( )|SQRT( )]]| Calculates the square root of a number.|
|[[desktop:desktop_chart_scripting_function_reference_TAN( )|TAN( )]] |Calculates the tangent of the value.|
|[[desktop:desktop_chart_scripting_function_reference_WILDERMA( )|WILDERMA( )]]|Computes a Wells Wilder simple moving average of the value.|
----
====== Plotting, Summary and Configuration Functions ======
----
^ Field ^ Description ^
| [[desktop:desktop_chart_scripting_function_reference_plot_line(...)|PLOT_LINE(...)]] | Draws a line plot of the value.|
| [[desktop:desktop_chart_scripting_function_reference_PLOT_BAND(...)|PLOT_BAND(...)]] | Draws a line plot of the value with upper and lower bands and option shading between the bands.|
| [[desktop:desktop_chart_scripting_function_reference_PLOT_STEP(...)|PLOT_STEP(...)]] | Draws a step plot of the value. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_POINTS(...)|PLOT_POINTS(...)]] | Draws a point plot of the value. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_RIBBON(...)|PLOT_RIBBON(...)]]| Draws a ribbon plot of the value. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_WAVECREST(...)|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. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_HISTOGRAM(...)|PLOT_HISTOGRAM(...)]]| Draws a histogram (columnar) plot of the value. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_LIMITLINE(...)|PLOT_LIMITLINE(...)]] | Draws a histogram (columnar) plot of the value.|
| [[desktop:desktop_chart_scripting_function_reference_PLOT_CENTERLINE(...)|PLOT_CENTERLINE(...)]] | Draws a histogram (columnar) plot of the value. |
| [[desktop:desktop_chart_scripting_function_reference_PLOT_RANGEMARKERS(...)|PLOT_RANGEMARKERS(...)]] | Draws a histogram (columnar) plot of the value.|
| [[desktop:desktop_chart_scripting_function_reference_SUMMARY(...)|SUMMARY(...)]]| Displays a summary for the plot.|
----