AFL Function Reference - Alphabetical list of functions

  1. #include ( Miscellaneous functions) - preprocessor include command (AFL 2.2)
  2. #pragma ( Miscellaneous functions) - sets AFL pre-processor option (AFL 2.4)
  3. abs ( Math functions) - absolute value
  4. AccDist ( Indicators) - accumulation/distribution
  5. AddColumn (Exploration /Indicator Builder) - add numeric exploration column (AFL 1.8)
  6. AddTextColumn (Exploration /Indicator Builder) - add text exploration column (AFL 1.8)
  7. AddToComposite ( Composites) - add value to composite ticker (AFL 2.0)
  8. ADLine ( Composites) - advance/decline line (AFL 1.2)
  9. AdvIssues ( Composites) - advancing issues (AFL 1.2)
  10. AdvVolume ( Composites) - advancing issues volume (AFL 1.2)
  11. ADX ( Indicators) - average directional movement index (AFL 1.3)
  12. AlertIf ( Trading system toolbox) - trigger alerts (AFL 2.1)
  13. AMA ( Moving averages, summation) - adaptive moving average (AFL 1.5)
  14. AMA2 ( Moving averages, summation) - adaptive moving average (AFL 1.5)
  15. ApplyStop ( Trading system toolbox) - apply built-in stop (AFL 1.7)
  16. atan ( Math functions) - arc tan
  17. ATR ( Indicators) - average true range (AFL 1.3)
  18. BarIndex ( Date/Time) - get zero-based bar number (AFL 2.3)
  19. BarsSince ( Trading system toolbox) - bars since
  20. BBandBot ( Indicators) - bottom bollinger band
  21. BBandTop ( Indicators) - top bollinger band
  22. BeginValue ( Date/Time) - Value of the array at the begin of the range (AFL 2.3)
  23. CategoryAddSymbol ( Information / Categories) - adds a symbol to a category (AFL 2.5)
  24. CategoryGetName ( Information / Categories) - get the name of a category (AFL 2.5)
  25. CategoryGetSymbols ( Information / Categories) - retrieves comma-separated list of symbols belonging to given category (AFL 2.5)
  26. CategoryRemoveSymbol ( Information / Categories) - remove a symbol from a category (AFL 2.5)
  27. CCI ( Indicators) - commodity channel index
  28. CEIL ( Math functions) - ceil value
  29. CHAIKIN ( Indicators) - chaikin oscillator
  30. CORRELATION ( Statistical functions) - correlation (AFL 1.4)
  31. COS ( Math functions) - cosine
  32. CREATEOBJECT ( Miscellaneous functions) - create COM object (AFL 1.8)
  33. CREATESTATICOBJECT ( Miscellaneous functions) - create static COM object (AFL 1.8)
  34. CROSS ( Trading system toolbox) - crossover check
  35. CUM ( Moving averages, summation) - cumulative sum
  36. DATE ( Date/Time) - date (AFL 1.1)
  37. DATENUM ( Date/Time) - date number (AFL 1.4)
  38. DATETIME ( Date/Time) - retrieves encoded date time (AFL 2.3)
  39. DAY ( Date/Time) - day of month (AFL 1.4)
  40. DAYOFWEEK ( Date/Time) - day of week (AFL 1.4)
  41. DAYOFYEAR ( Date/Time) - get ordinal number of day in a year (AFL 2.4)
  42. DECISSUES ( Composites) - declining issues (AFL 1.2)
  43. DECVOLUME ( Composites) - declining issues volume (AFL 1.2)
  44. DEMA ( Moving averages, summation) - double exponential moving average (AFL 2.0)
  45. EMA ( Moving averages, summation) - exponential moving average
  46. EnableRotationalTrading ( Trading system toolbox) - Turns on rotational-trading mode of the backtester (AFL 2.5)
  47. ENABLESCRIPT ( Miscellaneous functions) - enable scripting engine
  48. ENABLETEXTOUTPUT ( Miscellaneous functions) - enables/disables text output in the Chart Commentary window (AFL 2.2)
  49. ENCODECOLOR (Exploration /Indicator Builder) - encodes color for indicator title (AFL 2.2)
  50. ENDVALUE ( Date/Time) - value of the array at the begin of the selected range (AFL 2.3)
  51. EQUITY ( Trading system toolbox) - calculate equity line (AFL 2.0)
  52. EXP ( Math functions) - exponential function
  53. EXREM ( Trading system toolbox) - remove excessive signals (AFL 1.5)
  54. EXREMSPAN ( Trading system toolbox) - remove excessive signals spanning given number of bars (AFL 2.0)
  55. fclose (File Input/Output functions) - close a file (AFL 2.5)
  56. feof (File Input/Output functions) - test for end-of-file (AFL 2.5)
  57. fgets (File Input/Output functions) - get a string from a file (AFL 2.5)
  58. FLIP ( Trading system toolbox) - (AFL 1.5)
  59. FLOOR ( Math functions) - floor value
  60. fopen (File Input/Output functions) - open a file (AFL 2.5)
  61. FOREIGN (Referencing other symbol data) - access foreign security data (AFL 1.5)
  62. fputs (File Input/Output functions) - write a string to a file (AFL 2.5)
  63. FRAC ( Math functions) - fractional part
  64. FullName ( Information / Categories) - full name of the symbol (AFL 1.1)
  65. GAPDOWN ( Basic price pattern detection) - gap down
  66. GAPUP ( Basic price pattern detection) - gap up
  67. GETBASEINDEX (Referencing other symbol data) - retrieves symbol of relative strength base index (AFL 2.1)
  68. GetCategorySymbols ( Information / Categories) - retrieves comma-separated list of symbols belonging to given category (AFL 2.4)
  69. GETCHARTID (Exploration /Indicator Builder) - get current chart ID (AFL 2.3)
  70. GetDatabaseName ( Information / Categories) - retrieves folder name of current database (AFL 2.3)
  71. GETEXTRADATA ( Miscellaneous functions) - get extra data from external data source (AFL 1.9)
  72. GETSCRIPTOBJECT ( Miscellaneous functions) - get access to script COM object (AFL 1.8)
  73. GROUPID ( Information / Categories) - get group ID/name (AFL 1.8)
  74. HHV ( Lowest/Highest) - highest high value
  75. HHVBARS ( Lowest/Highest) - bars since highest high
  76. HIGHEST ( Lowest/Highest) - highest value
  77. HIGHESTBARS ( Lowest/Highest) - bars since highest value
  78. HIGHESTSINCE ( Lowest/Highest) - highest value since condition met (AFL 1.4)
  79. HIGHESTSINCEBARS ( Lowest/Highest) - bars since highest value since condition met (AFL 1.4)
  80. HOLD ( Trading system toolbox) - hold the alert signal
  81. HOUR ( Date/Time) - get current bar's hour (AFL 2.0)
  82. IIF ( Trading system toolbox) - immediate IF function
  83. INDUSTRYID ( Information / Categories) - get industry ID / name (AFL 1.8)
  84. INSIDE ( Basic price pattern detection) - inside day
  85. INT ( Math functions) - integer part
  86. INTERVAL ( Date/Time) - get bar interval (in seconds) (AFL 2.1)
  87. INWATCHLIST ( Information / Categories) - watch list membership test
  88. ISEMPTY ( Miscellaneous functions) - empty value check (AFL 1.5)
  89. IsFavorite ( Information / Categories) - check if current symbol belongs to favorites (AFL 2.5)
  90. ISFINITE ( Miscellaneous functions) - check if value is not infinite (AFL 2.3)
  91. IsIndex ( Information / Categories) - check if current symbol is an index (AFL 2.5)
  92. ISNAN ( Miscellaneous functions) - checks for NaN (not a number) (AFL 2.3)
  93. ISNULL ( Miscellaneous functions) - check for Null (empty) value (AFL 2.3)
  94. ISTRUE ( Miscellaneous functions) - true value (non-empty and non-zero) check (AFL 1.5)
  95. LASTVALUE ( Trading system toolbox) - last value of the array
  96. LineArray (Exploration /Indicator Builder) - generate trend-line array (AFL 2.5)
  97. LINEARREG ( Statistical functions) - linear regression end-point (AFL 2.2)
  98. LINREGINTERCEPT ( Statistical functions) - (AFL 2.2)
  99. LINREGSLOPE ( Statistical functions) - linear regression slope (AFL 1.4)
  100. LLV ( Lowest/Highest) - lowest low value
  101. LLVBARS ( Lowest/Highest) - bars since lowest low
  102. LOG ( Math functions) - natural logarithm
  103. LOG10 ( Math functions) - decimal logarithm
  104. LOWEST ( Lowest/Highest) - lowest value
  105. LOWESTBARS ( Lowest/Highest) - bars since lowest
  106. LOWESTSINCE ( Lowest/Highest) - lowest value since condition met (AFL 1.4)
  107. LOWESTSINCEBARS ( Lowest/Highest) - barssince lowest value since condition met (AFL 1.4)
  108. MA ( Moving averages, summation) - simple moving average
  109. MACD ( Indicators) - moving average convergence/divergence
  110. MARKETID ( Information / Categories) - market ID / name (AFL 1.8)
  111. MAX ( Math functions) - maximum value of two numbers / arrays
  112. MDI ( Indicators) - minus directional movement indicator (-DI) (AFL 1.3)
  113. Median ( Statistical functions) - calculate median (middle element) (AFL 2.5)
  114. MFI ( Indicators) - money flow index
  115. MIN ( Math functions) - minimum value of two numbers / arrays
  116. MINUTE ( Date/Time) - get current bar's minute (AFL 2.0)
  117. MONTH ( Date/Time) - month (AFL 1.4)
  118. NAME ( Information / Categories) - ticker symbol (AFL 1.1)
  119. NOW ( Date/Time) - gets current system date/time (AFL 2.3)
  120. NumToStr ( String manipulation) - convert number to string (AFL 2.5)
  121. NVI ( Indicators) - negative volume index
  122. NZ ( Miscellaneous functions) - Null (Null/Nan/Infinity) to zero (AFL 2.3)
  123. OBV ( Indicators) - on balance volume
  124. OPTIMIZE ( Trading system toolbox) - define optimization variable (AFL 1.7)
  125. OSCP ( Indicators) - price oscillator
  126. OSCV ( Indicators) - volume oscillator
  127. OUTSIDE ( Basic price pattern detection) - outside bar
  128. PARAM (Exploration /Indicator Builder) - add user user-definable numeric parameter (AFL 2.3)
  129. PARAMCOLOR (Exploration /Indicator Builder) - add user user-definable color parameter (AFL 2.3)
  130. PARAMSTR (Exploration /Indicator Builder) - add user user-definable string parameter (AFL 2.3)
  131. PDI ( Indicators) - plus directional movement indicator (AFL 1.3)
  132. PEAK ( Basic price pattern detection) - peak (AFL 1.1)
  133. PEAKBARS ( Basic price pattern detection) - bars since peak (AFL 1.1)
  134. Percentile ( Statistical functions) - calculate percentile (AFL 2.5)
  135. PLOT (Exploration /Indicator Builder) - plot indicator graph (AFL 1.8)
  136. PLOTFOREIGN (Referencing other symbol data) - plot foreign security data (AFL 2.2)
  137. PLOTGRID (Exploration /Indicator Builder) - Plot horizontal grid line (AFL 2.3)
  138. PLOTOHLC (Exploration /Indicator Builder) - plot custom OHLC chart (AFL 2.2)
  139. PLOTSHAPES (Exploration /Indicator Builder) - plots arrows and other shapes (AFL 2.3)
  140. PLOTVAPOVERLAY (Exploration /Indicator Builder) - plot Volume-At-Price overlay chart (AFL 2.4)
  141. PREC ( Math functions) - adjust number of decimal points of floating point number
  142. PREFS ( Miscellaneous functions) - retrieve preferences settings (AFL 1.4)
  143. printf ( String manipulation) - Print formatted output to the output window. (AFL 2.5)
  144. PVI ( Indicators) - positive volume index
  145. RANDOM ( Statistical functions) - random number (AFL 1.9)
  146. REF ( Trading system toolbox) - reference past/future values of the array
  147. RELSTRENGTH (Referencing other symbol data) - comparative relative strength (AFL 1.3)
  148. RestorePriceArrays (Referencing other symbol data) - restore price arrays to original symbol (AFL 2.5)
  149. RMI ( Indicators) - Relative Momentum Index (AFL 2.1)
  150. ROC ( Indicators) - percentage rate of change
  151. ROUND ( Math functions) - round number to nearest integer
  152. RSI ( Indicators) - relative strength index
  153. RWI ( Indicators) - random walk index
  154. RWIHI ( Indicators) - random walk index of highs
  155. RWILO ( Indicators) - random walk index of lows
  156. SAR ( Indicators) - parabolic stop-and-reverse (AFL 1.3)
  157. SECOND ( Date/Time) - get current bar's second (AFL 2.0)
  158. SECTORID ( Information / Categories) - get sector ID / name (AFL 1.8)
  159. SELECTEDVALUE (Exploration /Indicator Builder) - retrieves value of the array at currently selected date/time point (AFL 2.1)
  160. SETBARSREQUIRED ( Miscellaneous functions) - set number of previous and future bars needed for script/DLL to properly execute (AFL 2.1)
  161. SetForeign (Referencing other symbol data) - replace current price arrays with those of foreign security (AFL 2.5)
  162. SetFormulaName ( Trading system toolbox) - set the name of the formula (AFL 2.5)
  163. SetOption ( Trading system toolbox) - sets options in automatic analysis settings (AFL 2.3)
  164. SETTRADEDELAYS ( Trading system toolbox) - allows to control trade delays applied by the backtester (AFL 2.1)
  165. SIGNAL ( Indicators) - macd signal line
  166. SIN ( Math functions) - sine function
  167. SQRT ( Math functions) - square root
  168. STATUS ( Miscellaneous functions) - get run-time AFL status information (AFL 1.65)
  169. STDERR ( Statistical functions) - standard error (AFL 1.4)
  170. STDEV ( Statistical functions) - standard deviation (AFL 1.4)
  171. STOCHD ( Indicators) - stochastic slow %D
  172. STOCHK ( Indicators) - stochastic slow %K
  173. StrExtract ( String manipulation) - extracts given item (substring) from comma-separated string (AFL 2.4)
  174. StrFind ( String manipulation) - find substring in a string (AFL 2.5)
  175. StrFormat ( String manipulation) - Write formatted output to the string (AFL 2.5)
  176. StrLeft ( String manipulation) - extracts the leftmost part (AFL 2.0)
  177. StrLen ( String manipulation) - string length (AFL 1.5)
  178. StrMid ( String manipulation) - extracts part of the string (AFL 2.0)
  179. StrRight ( String manipulation) - extracts the rightmost part of the string (AFL 2.0)
  180. StrToNum ( String manipulation) - convert string to number (AFL 2.5)
  181. STUDY ( Miscellaneous functions) - reference hand-drawn study (AFL 1.5)
  182. SUM ( Moving averages, summation) - sum data over specified number of bars
  183. TEMA ( Moving averages, summation) - triple exponential moving average (AFL 2.0)
  184. TimeFrameCompress (Time Frame functions) - compress single array to given time frame (AFL 2.5)
  185. TimeFrameExpand (Time Frame functions) - expand time frame compressed array (AFL 2.5)
  186. TimeFrameGetPrice (Time Frame functions) - retrieve O, H, L, C, V values from other time frame (AFL 2.5)
  187. TimeFrameRestore (Time Frame functions) - restores price arrays to original time frame (AFL 2.5)
  188. TimeFrameSet (Time Frame functions) - switch price arrays to a different time frame (AFL 2.5)
  189. TIMENUM ( Date/Time) - get current bar time (AFL 2.0)
  190. TRIN ( Composites) - traders (Arms) index (AFL 1.2)
  191. TRIX ( Indicators) - triple exponential smoothed price
  192. TROUGH ( Basic price pattern detection) - trough (AFL 1.1)
  193. TROUGHBARS ( Basic price pattern detection) - bars since trough (AFL 1.1)
  194. TSF ( Statistical functions) - time series forecast (AFL 2.2)
  195. ULTIMATE ( Indicators) - ultimate oscillator
  196. UNCISSUES ( Composites) - unchanged issues (AFL 1.2)
  197. UNCVOLUME ( Composites) - unchaged issues volume (AFL 1.2)
  198. VALUEWHEN ( Trading system toolbox) - get value of the array when condition met (AFL 1.1)
  199. VERSION ( Miscellaneous functions) - get version info (AFL 1.9)
  200. WILDERS ( Moving averages, summation) - Wilder's smoothing (AFL 1.4)
  201. WMA ( Moving averages, summation) - weighted moving average (AFL 2.0)
  202. WRITEIF (Exploration /Indicator Builder) - commentary conditional text output
  203. WriteVal (Exploration /Indicator Builder) - write number or value of the array
  204. YEAR ( Date/Time) - year (AFL 1.4)
  205. ZIG ( Basic price pattern detection) - zig-zag indicator (AFL 1.1)
  206. _N (Exploration /Indicator Builder) - no text output (AFL 2.1)
  207. _TRACE ( Miscellaneous functions) - print text to system debug viewer (AFL 2.4)