Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Function Reference - Categorized list of functions

Basic price pattern detection

Composites

  • AddToComposite - add value to composite ticker (AFL 2.0)
  • ADLine - advance/decline line (AFL 1.2)
  • AdvIssues - advancing issues (AFL 1.2)
  • AdvVolume - advancing issues volume (AFL 1.2)
  • DecIssues - declining issues (AFL 1.2)
  • DecVolume - declining issues volume (AFL 1.2)
  • Trin - traders (Arms) index (AFL 1.2)
  • UncIssues - unchanged issues (AFL 1.2)
  • UncVolume - unchaged issues volume (AFL 1.2)

Date/Time

  • BarIndex - get zero-based bar number (AFL 2.3)
  • BeginValue - Value of the array at the begin of the range (AFL 2.3)
  • Date - date (AFL 1.1)
  • DateNum - date number (AFL 1.4)
  • DateTime - retrieves encoded date time (AFL 2.3)
  • DateTimeAdd - adds specified number of seconds/minutes/hours/days to datetime (AFL 3.40)
  • DateTimeConvert - date/time format conversion (AFL 2.90)
  • DateTimeDiff - get difference in seconds between two datetime values (AFL 3.30)
  • Day - day of month (AFL 1.4)
  • DayOfWeek - day of week (AFL 1.4)
  • DayOfYear - get ordinal number of day in a year (AFL 2.4)
  • DaysSince1900 - get number of days since January 1st, 1900 (AFL 3.20)
  • EndValue - value of the array at the end of the selected range (AFL 2.3)
  • GetPlaybackDateTime - get bar replay position date/time (AFL 3.0)
  • Hour - get current bar's hour (AFL 2.0)
  • Interval - get bar interval (in seconds) (AFL 2.1)
  • Lookup - search the array for bar with specified date/time (AFL 3.40)
  • MicroSec - get bar's microsecond part of the timestamp
  • MilliSec - get bar's millisecond part of the timestamp
  • Minute - get current bar's minute (AFL 2.0)
  • Month - month (AFL 1.4)
  • Now - gets current system date/time (AFL 2.3)
  • Second - get current bar's second (AFL 2.0)
  • TimeNum - get current bar time (AFL 2.0)
  • Year - year (AFL 1.4)
  • _DT - convert string to datetime (AFL 3.40)

Indicators

  • AccDist - accumulation/distribution
  • ADX - average directional movement index (AFL 1.3)
  • ATR - average true range (AFL 1.3)
  • BBandBot - bottom bollinger band
  • BBandTop - top bollinger band
  • CCI - commodity channel index
  • Chaikin - chaikin oscillator
  • ColorBlend - blends (mixes) two colors (AFL 3.30)
  • FirstVisibleValue - get first visible value of array (AFL 3.40)
  • GetChartBkColor - get the RGB color value of chart background (AFL 3.20)
  • GetCursorMouseButtons - get current state of mouse buttons (AFL 2.80)
  • GetCursorXPosition - get current X position of mouse pointer (AFL 2.80)
  • GetCursorYPosition - get current Y position of mouse pointer (AFL 2.80)
  • HighestVisibleValue - get the highest value within visible chart area (AFL 3.30)
  • LastVisibleValue - get last visible value of array (AFL 3.40)
  • LowestVisibleValue - get the lowest value within visible chart area (AFL 3.30)
  • MACD - moving average convergence/divergence
  • MDI - minus directional movement indicator (-DI) (AFL 1.3)
  • MFI - money flow index
  • NVI - negative volume index
  • OBV - on balance volume
  • OscP - price oscillator
  • OscV - volume oscillator
  • PDI - plus directional movement indicator (AFL 1.3)
  • PercentRank - calculate percent rank (AFL 3.40)
  • PlotText - write text on the chart (AFL 2.80)
  • PlotVAPOverlayA - plot multiple-segment Volume-At-Price chart (AFL 3.20)
  • PVI - positive volume index
  • RequestTimedRefresh - forces periodical refresh of indicator pane (AFL 2.90)
  • RMI - Relative Momentum Index (AFL 2.1)
  • ROC - percentage rate of change
  • RSI - relative strength index
  • RWI - random walk index
  • RWIHi - random walk index of highs
  • RWILo - random walk index of lows
  • SAR - parabolic stop-and-reverse (AFL 1.3)
  • SetBarFillColor - set bar/candlestick/cloud chart fill color (AFL 3.1)
  • SetChartBkColor - set background color of a chart (AFL 2.80)
  • SetChartBkGradientFill - enables background gradient color fill in indicators (AFL 2.90)
  • Signal - macd signal line
  • StochD - stochastic slow %D
  • StochK - stochastic slow %K
  • TRIX - triple exponential smoothed price
  • Ultimate - ultimate oscillator

Information / Categories

  • CategoryAddSymbol - adds a symbol to a category (AFL 2.5)
  • CategoryFind - search for category by name (AFL 3.0)
  • CategoryGetName - get the name of a category (AFL 2.5)
  • CategoryGetSymbols - retrieves comma-separated list of symbols belonging to given category (AFL 2.5)
  • CategoryRemoveSymbol - remove a symbol from a category (AFL 2.5)
  • CategorySetName - set the name of category (group, market, watch list, industry) (AFL 3.20)
  • FullName - full name of the symbol (AFL 1.1)
  • GetCategorySymbols - retrieves comma-separated list of symbols belonging to given category (AFL 2.4)
  • GetDatabaseName - retrieves folder name of current database (AFL 2.3)
  • GetFnData - get fundamental data (AFL 2.90)
  • GicsID - get GICS category information (AFL 3.40)
  • GroupID - get group ID/name (AFL 1.8)
  • IndustryID - get industry ID / name (AFL 1.8)
  • InGICS - test GICS membership (AFL 3.40)
  • InWatchList - watch list membership test (by ordinal number)
  • InWatchListName - watch list membership test (by name) (AFL 3.0)
  • IsContinuous - checks 'continuous quotations' flag state (AFL 2.60)
  • IsFavorite - check if current symbol belongs to favorites (AFL 2.5)
  • IsIndex - check if current symbol is an index (AFL 2.5)
  • MarketID - market ID / name (AFL 1.8)
  • Name - ticker symbol (AFL 1.1)
  • SectorID - get sector ID / name (AFL 1.8)

Lowest/Highest

Math functions

  • abs - absolute value
  • acos - arccosine function
  • AlmostEqual - rounding error insensitive comparison (AFL 2.80)
  • asin - arcsine function
  • atan - arc tan
  • atan2 - calculates arctangent of y/x (AFL 2.90)
  • ceil - ceil value
  • cos - cosine
  • cosh - hyperbolic cosine function (AFL 2.80)
  • EXP - exponential function
  • floor - floor value
  • frac - fractional part
  • Int - integer part
  • log - natural logarithm
  • log10 - decimal logarithm
  • Max - maximum value of two numbers / arrays
  • Min - minimum value of two numbers / arrays
  • Prec - adjust number of decimal points of floating point number
  • Round - round number to nearest integer
  • sign - returns the sign of the number/array (AFL 2.50)
  • sin - sine function
  • sinh - hyperbolic sine function (AFL 2.80)
  • sqrt - square root
  • tan - tangent function (AFL 1.0)
  • tanh - hyperbolic tangent function (AFL 2.80)

Miscellaneous functions

  • #include - preprocessor include command (AFL 2.2)
  • #include_once - preprocessor include (once) command (AFL 2.70)
  • #pragma - sets AFL pre-processor option (AFL 2.4)
  • ClipboardGet - retrieves current contents of Windows clipboard (AFL 2.60)
  • ClipboardSet - copies the text to the Windows clipboard (AFL 2.6)
  • ColorHSB - specify color using Hue-Saturation-Brightness (AFL 2.80)
  • ColorRGB - specify color using Red-Green-Blue components (AFL 2.80)
  • CreateObject - create COM object (AFL 1.8)
  • CreateStaticObject - create static COM object (AFL 1.8)
  • EnableScript - enable scripting engine
  • EnableTextOutput - enables/disables text output in the Chart Commentary window (AFL 2.2)
  • GetExtraData - get extra data from external data source (AFL 1.9)
  • GetPerformanceCounter - retrieves the current value of the high-resolution performance counter (AFL 2.90)
  • GetRTData - retrieves the real-time data fields (AFL 2.60)
  • GetRTDataForeign - retrieves the real-time data fields (for specified symbol) (AFL 2.80)
  • GetScriptObject - get access to script COM object (AFL 1.8)
  • IsEmpty - empty value check (AFL 1.5)
  • IsFinite - check if value is not infinite (AFL 2.3)
  • IsNan - checks for NaN (not a number) (AFL 2.3)
  • IsNull - check for Null (empty) value (AFL 2.3)
  • IsTrue - true value (non-empty and non-zero) check (AFL 1.5)
  • NoteGet - retrieves the text of the note (AFL 2.6)
  • NoteSet - sets text of the note (AFL 2.6)
  • Nz - Null (Null/Nan/Infinity) to zero (AFL 2.3)
  • PlaySound - play back specified .WAV file (AFL 3.40)
  • PopupWindow - display pop-up window (AFL 3.0)
  • Prefs - retrieve preferences settings (AFL 1.4)
  • Say - speaks provided text (AFL 2.90)
  • SetBarsRequired - set number of previous and future bars needed for script/DLL to properly execute (AFL 2.1)
  • StaticVarCompareExchange - atomic interlocked static variable compare-exchange operation (AFL 3.50)
  • StaticVarCount - get the total number of static variables in memory (AFL 3.30)
  • StaticVarGet - gets the value of static variable (AFL 2.60)
  • StaticVarGetText - gets the value of static variable as string (AFL 2.60)
  • StaticVarRemove - remove static variable (AFL 2.80)
  • StaticVarSet - sets the value of static variable (AFL 2.60)
  • StaticVarSetText - Sets the value of static string variable. (AFL 2.60)
  • Status - get run-time AFL status information (AFL 1.65)
  • Study - reference hand-drawn study (AFL 1.5)
  • ThreadSleep - suspend thread for specified number of milliseconds (AFL 3.50)
  • VarGet - gets the value of dynamic variable (AFL 2.60)
  • VarGetText - gets the text value of dynamic variable (AFL 2.80)
  • VarSet - sets the value of dynamic variable (AFL 2.60)
  • VarSetText - sets dynamic variable of string type (AFL 2.80)
  • Version - get version info (AFL 1.9)
  • _TRACE - print text to system debug viewer (AFL 2.4)

Moving averages, summation

  • AMA - adaptive moving average (AFL 1.5)
  • AMA2 - adaptive moving average (AFL 1.5)
  • Cum - cumulative sum
  • DEMA - double exponential moving average (AFL 2.0)
  • EMA - exponential moving average
  • FIR - Finite Impulse Response filter (AFL 3.40)
  • HMA - Hull Moving Average (AFL 3.40)
  • MA - simple moving average
  • Sum - sum data over specified number of bars
  • TEMA - triple exponential moving average (AFL 2.0)
  • Wilders - Wilder's smoothing (AFL 1.4)
  • WMA - weighted moving average (AFL 2.0)

Statistical functions

  • Correlation - correlation (AFL 1.4)
  • LinearReg - linear regression end-point (AFL 2.2)
  • LinRegIntercept - (AFL 2.2)
  • LinRegSlope - linear regression slope (AFL 1.4)
  • Median - calculate median (middle element) (AFL 2.5)
  • mtRandom - Mersene Twister random number generator (AFL 3.0)
  • mtRandomA - Mersene Twister random number generator (array version) (AFL 3.0)
  • Percentile - calculate percentile (AFL 2.5)
  • Random - random number (AFL 1.9)
  • StdErr - standard error (AFL 1.4)
  • StDev - standard deviation (AFL 1.4)
  • TSF - time series forecast (AFL 2.2)

String manipulation

  • Asc - get ASCII code of character (AFL 2.80)
  • DateTimeToStr - convert datetime to string (AFL 2.8)
  • NumToStr - convert number to string (AFL 2.5)
  • printf - Print formatted output to the output window. (AFL 2.5)
  • StrCount - count the occurrences of substring within a string (AFL 3.20)
  • StrExtract - extracts given item (substring) from comma-separated string (AFL 2.4)
  • StrFind - find substring in a string (AFL 2.5)
  • StrFormat - Write formatted output to the string (AFL 2.5)
  • StrLeft - extracts the leftmost part (AFL 2.0)
  • StrLen - string length (AFL 1.5)
  • StrMid - extracts part of the string (AFL 2.0)
  • StrReplace - string replace (AFL 2.90)
  • StrRight - extracts the rightmost part of the string (AFL 2.0)
  • StrToDateTime - convert string to datetime (AFL 2.80)
  • StrToLower - convert to lowercase (AFL 2.80)
  • StrToNum - convert string to number (AFL 2.5)
  • StrToUpper - convert to uppercase (AFL 2.80)

Trading system toolbox

  • AlertIf - trigger alerts (AFL 2.1)
  • ApplyStop - apply built-in stop (AFL 1.7)
  • BarsSince - bars since
  • Cross - crossover check
  • EnableRotationalTrading - Turns on rotational-trading mode of the backtester (AFL 2.5)
  • Equity - calculate single-symbol equity line (AFL 2.0)
  • ExRem - remove excessive signals (AFL 1.5)
  • ExRemSpan - remove excessive signals spanning given number of bars (AFL 2.0)
  • Flip - (AFL 1.5)
  • GetBacktesterObject - get the access to backtester object (AFL 2.60)
  • GetOption - gets the value of option in automatic analysis settings (AFL 2.60)
  • GetTradingInterface - retrieves OLE automation object to automatic trading interfac (AFL 2.70)
  • Hold - hold the alert signal
  • IIf - immediate IF function
  • LastValue - last value of the array
  • Optimize - define optimization variable (AFL 1.7)
  • OptimizerSetEngine - select external optimization engine (AFL 3.20)
  • OptimizerSetOption - set the value of external optimizer engine parameter (AFL 3.20)
  • Ref - reference past/future values of the array
  • SetBacktestMode - Sets working mode of the backtester (AFL 3.0)
  • SetCustomBacktestProc - define custom backtest procedure formula file (AFL 2.70)
  • SetFormulaName - set the name of the formula (AFL 2.5)
  • SetOption - sets options in automatic analysis settings (AFL 2.3)
  • SetPositionSize - set trade size (AFL 2.70)
  • SetTradeDelays - allows to control trade delays applied by the backtester (AFL 2.1)
  • ValueWhen - get value of the array when condition met (AFL 1.1)

Exploration / Indicators

  • AddColumn - add numeric exploration column (AFL 1.8)
  • AddSummaryRows - add summary row(s) to the exploration output (AFL 3.2)
  • AddTextColumn - add text exploration column (AFL 1.8)
  • EncodeColor - encodes color for indicator title (AFL 2.2)
  • GetChartID - get current chart ID (AFL 2.3)
  • GetPriceStyle - get current price chart style (AFL 2.70)
  • LineArray - generate trend-line array (AFL 2.5)
  • Param - add user user-definable numeric parameter (AFL 2.3)
  • ParamColor - add user user-definable color parameter (AFL 2.3)
  • ParamDate - add user user-definable date parameter (AFL 2.60)
  • ParamField - creates price field parameter (AFL 2.70)
  • ParamList - creates the parameter that consist of the list of choices (AFL 2.70)
  • ParamStr - add user user-definable string parameter (AFL 2.3)
  • ParamStyle - select styles applied to the plot (AFL 2.70)
  • ParamTime - add user user-definable time parameter (AFL 2.60)
  • ParamToggle - create Yes/No parameter (AFL 2.70)
  • ParamTrigger - creates a trigger (button) in the parameter dialog (AFL 2.70)
  • Plot - plot indicator graph (AFL 1.8)
  • PlotGrid - Plot horizontal grid line (AFL 2.3)
  • PlotOHLC - plot custom OHLC chart (AFL 2.2)
  • PlotShapes - plots arrows and other shapes (AFL 2.3)
  • PlotVAPOverlay - plot Volume-At-Price overlay chart (AFL 2.4)
  • SelectedValue - retrieves value of the array at currently selected date/time point (AFL 2.1)
  • SetChartOptions - set/clear/overwrite defaults for chart pane options (AFL 2.70)
  • SetSortColumns - sets the columns which will be used for sorting in AA window (AFL 2.90)
  • WriteIf - commentary conditional text output
  • WriteVal - converts number to string
  • _DEFAULT_NAME - retrive default name of the plot (AFL 2.70)
  • _N - no text output (AFL 2.1)
  • _PARAM_VALUES - retrieve param values string (AFL 2.70)
  • _SECTION_BEGIN - section begin marker (AFL 2.70)
  • _SECTION_END - section end marker (AFL 2.70)
  • _SECTION_NAME - retrieve current section name (AFL 2.70)

File Input/Output functions

  • fclose - close a file (AFL 2.5)
  • fdelete - deletes a file (AFL 2.70)
  • feof - test for end-of-file (AFL 2.5)
  • fgets - get a string from a file (AFL 2.5)
  • fgetstatus - retrieves file status/properties (AFL 2.90)
  • fmkdir - creates (makes) a directory (AFL 2.70)
  • fopen - open a file (AFL 2.5)
  • fputs - write a string to a file (AFL 2.5)
  • frmdir - removes a directory (AFL 2.70)

Low-level graphics

Referencing other symbol data

  • Foreign - access foreign security data (AFL 1.5)
  • GetBaseIndex - retrieves symbol of relative strength base index (AFL 2.1)
  • PlotForeign - plot foreign security data (AFL 2.2)
  • RelStrength - comparative relative strength (AFL 1.3)
  • RestorePriceArrays - restore price arrays to original symbol (AFL 2.5)
  • SetForeign - replace current price arrays with those of foreign security (AFL 2.5)

Time Frame functions


About | Privacy | Terms of Use | Contact information
Copyright © 2003 AMIBROKER.COM