# Functions and Indicators

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

## Built-in Functions

Function Name Identifier Type Description
Account BT_ACCOUNT Information Provides crucial information like your current balance, equity, available margin, leverage, etc.
Account Info BT_ACCOUNTINFO Information Provides crucial information like your current balance, equity, available margin, leverage, etc.
Close Group BT_CLOSEGROUP Order Closes one or more orders: this function can be used as a filter.
Close Order BT_CLOSEORDER Order Closes an order. This function will execute immediately if not inside a condition.
Delete Order BT_DELETEORDER Order Deletes a pending order. This function will execute immediately if not inside a condition.
Get CSV Item BT_GETCSVITEM Information Imports a CSV file.
List Candles BT_LISTCANDLES Information Insert an automatically updated list of all the candles of a selected pair. This function is required for all BT included indicators.
List Closed Orders BT_LISTCLOSEDORDERS Information Insert an automatically updated list of closed orders.
List Open Orders BT_LISTOPENORDERS Information Insert an automatically updated list of open orders.
List Pending Orders BT_LISTPENDINGORDERS Information Insert an automatically updated list of pending orders.
List Ticks BT_LISTTICKS Information Insert an automatically updated list of all the ticks of a selected pair.
Market BT_MARKET Information Provides general information on a specific pair.
Market Info BT_MARKETINFO Information Provides general information on a specific pair.
Modify Order BT_MODIFYORDER Order Modifies an existing pending order. This function will execute immediately if not inside a condition.
Open Order BT_OPENORDER Order Opens an order. This function will execute immediately if not inside a condition.
Signal BT_SIGNAL Order Send parameters to BT Signal indicator. Check MT4 data window to see statistics.

## Built-in Indicators

Indicator Name Identifier Type Description
Vector Absolute Value BT_I_ABS simple Vector Absolute Value calculates the absolute value of each element in the input array.[1]
Vector Arccosine BT_I_ACOS simple Vector Arccosine calculates the trigonometric arccosine of each element in the input array.
Accumulation/Distribution Line BT_I_AD indicator The Accumulation Distribution Line is a volume-based indicator designed to measure the cumulative flow of money into and out of a security
Accumulation/Distribution Oscillator BT_I_ADOSC indicator The Accumulation/Distribution Oscillator takes a moving average of n periods of Accumulation/Distribution Line subtracted from a moving average of m periods of Accumulation/Distribution Line.
Average Directional Movement Index BT_I_ADX indicator The Average Directional Movement Index can help determine trend strength.
Average Directional Movement Rating BT_I_ADXR indicator The Average Directional Movement Rating can help determine trend strength.
Awesome Oscillator BT_I_AO indicator The Awesome Oscillator helps determine momentum.
Absolute Price Oscillator BT_I_APO indicator Absolute Price Oscillator helps follow trends and has several uses.
Aroon BT_I_AROON indicator The Aroon indicator calculates two results: aroon-down and aroon-up. In combination, they can help determine when a trend is developing.
Aroon Oscillator BT_I_AROONOSC indicator The Aroon Oscillator indicator can help determine when the market is developing a trend.
Vector Arcsine BT_I_ASIN simple Vector Arcsine calculates the Trigonometric arcsine of each element in the input array.
Vector Arctangent BT_I_ATAN simple Vector Arctangent calculates the Trigonometric arctangent of each element in the input array.
Average True Range BT_I_ATR indicator Average True Range is a measure of volatility. It represents roughly how much you can expect a security to change in price on any given day.
Average Price BT_I_AVGPRICE overlay The Average Price indicator calculates the mean of the open, high, low, and close of a bar.
Bollinger Bands BT_I_BBANDS overlay The Bollinger Bands indicator calculates three results. A middle band, which is a Simple Moving Average, as well as upper and lower bands which are spaced off the middle band.
Balance of Power BT_I_BOP indicator The Balance of Power indicator measures the power of buyers vs sellers through evaulating the capability of each side to drive prices to acute levels.
Commodity Channel Index BT_I_CCI indicator The Commodity Channel Index​ is a momentum-based trading trading resource used in order to determine if an asset’s current condition is reaching an overbought or oversold stage.
Vector Ceiling BT_I_CEIL simple Rounds to the next highest integer (whole number).
Chande Momentum Oscillator BT_I_CMO indicator The Chande Momentum Oscillator (CMO) was developed for the purpose of allowing traders to attempt to capture the momentum of a security.
Vector Cosine BT_I_COS simple Calculates the Trigonometric cosine.
Vector Hyperbolic Cosine BT_I_COSH simple Calculates the Trigonometric hyperbolic cosine.
Crossany BT_I_CROSSANY math Crossany is a simple function that indicates when two input arrays cross each other.
Crossover BT_I_CROSSOVER math Crossover is a simple function that indicates when two input arrays crossover each other.
Chaikins Volatility BT_I_CVI indicator The Chaikin Volatility indicator depicts volatility by assessing the difference between the high and low for each period or trading bar.
Linear Decay BT_I_DECAY math Decay is a simple function used to propagate signals from the past into the future. It is useful in conjunction with algorithm trading and machine learning functions.
Double Exponential Moving Average BT_I_DEMA overlay The DEMA indicator removes the inherent lag associated with Moving Averages by placing more weight on recent values. The value of an EMA is essentially doubled in this instance.
Directional Indicator BT_I_DI indicator The Directional Indicator is a tool for assessing trend strength on any relevant asset. It is a tool for distinguishing between week and strong trends.
Vector Division BT_I_DIV simple Div simply takes two input arrays and divides them.
Directional Movement BT_I_DM indicator Work in progress
Detrended Price Oscillator BT_I_DPO indicator The Detrended Price Oscillator helps identify cycles.
Directional Movement Index BT_I_DX indicator The Directional Movement Index can help determine trend strength.
Exponential Decay BT_I_EDECAY math Decay is a simple function used to propagate signals from the past into the future. It is useful in conjunction with algorithm trading and machine learning functions.
Exponential Moving Average BT_I_EMA overlay An Exponential Moving Average (EMA) is a weighted Moving Average (MA) that places a greater weight and significance on more recent data price points.
Ease of Movement BT_I_EMV indicator Ease of movement is an indicator used by traders in their analysis to relate an asset's price change to its volume. The foundation behind this indicator contributes to understanding trend strength.
Vector Exponential BT_I_EXP simple Vector Exponential returns the exponential for each number in the input arary. That is, it calculates Euler's constant ${\displaystyle e}$ raised to the power of each input element.
Fisher Transform BT_I_FISHER indicator The Fisher Transform indicator is an oscillator which aids traders in identifying trend reversals. Uniquely transforms prices into a Gaussian normal distribution.
Vector Floor BT_I_FLOOR simple Vector Floor applies the floor function to each input in the input array. The floor function returns the largest preceding integer from the input. e.g. ${\displaystyle floor(x)}$ is the largest integer less than or equal to ${\displaystyle x}$.
Forecast Oscillator BT_I_FOSC indicator The Forecast Oscillator is an indicator that collates an asset’s close price to its time series forecast.
Hull Moving Average BT_I_HMA overlay Alan Hull developed the Hull Moving Average in his mission to create a moving average that is "responsive to current price activity while maintaining curve smoothness".
Kaufman Adaptive Moving Average BT_I_KAMA overlay The Kaufman Adaptive Moving Average tries to adjust it's smoothing to match the current market condition. It adapts to a fast moving average when prices are moving steadily in one direction and a slow moving average when the market exhibits a lot of noise.
Klinger Volume Oscillator BT_I_KVO indicator The Klinger Volume Oscillator (KVO or KO) is a volume-based indicator, it’s purpose is for assisting traders with identifying a longer-term view of trends by comparing volume to price.
Lag BT_I_LAG math The Lag indicator just introduces lag to its input. It is useful for "lookback" in building trading algorithms.
Linear Regression BT_I_LINREG overlay The Linear Regression indicator is essentially used to scan the upper and lower limits of a current trend.
Linear Regression Intercept BT_I_LINREGINTERCEPT indicator The Linear Regression is a smoothing functions that works by preforming linear least squares regression over a moving window. It then uses the linear model to predict the value for the current bar.
Linear Regression Slope BT_I_LINREGSLOPE indicator The Linear Regression Slope is a momentum indicator. It fits a line over a moving window using simple linear regression, and returns the slope of that line.
Vector Natural Log BT_I_LN simple Vector Natural Log returns the natural logarithm for each element in the input array.
Vector Base-10 Log BT_I_LOG10 simple Vector Base-10 Log returns the base-10 logarithm for each element in the input array.
Moving Average Convergence/Divergence BT_I_MACD indicator Moving Average Convergence/Divergence helps follow trends and has several uses.
Market Facilitation Index BT_I_MARKETFI indicator The Market Facilitation Index compares volume and price change.
Mass Index BT_I_MASS indicator The Mass Index is used to identify trend reversals.
Maximum In Period BT_I_MAX math The Maximum In Period indicator returns the maximum value in the last period n bars.
Mean Deviation Over Period BT_I_MD math The Mean Deviation Over Period indicator calculates the absolute mean deviation over a period.
Median Price BT_I_MEDPRICE overlay The median price indicator calculates the mean of the high and low for a bar. Despite the name, it does not calculate an actual median value.
Money Flow Index BT_I_MFI indicator The Money Flow Index represents the amount of money flowing into and out of a security.
Minimum In Period BT_I_MIN math The Minimum In Period indicator returns the minimum value in the last period n bars.
Momentum BT_I_MOM indicator The Momentum indicator calculates the change between the current price and the price ${\displaystyle n}$ bars ago.
Mesa Sine Wave BT_I_MSW indicator The Mesa Sine Wave helps identify cycles.
Vector Multiplication BT_I_MUL simple ${\displaystyle Mul}$ simply takes two input arrays and multiplies them.
Normalized Average True Range BT_I_NATR indicator Normalized Average True Range is a measure of volatility. Because Normalized Average True Range is normalized, it can be more useful than Average True Range when comparing across different price levels.
Negative Volume Index BT_I_NVI indicator Negative Volume Index tries to show what smart investors are doing by staying flat on up-volume days and only changing on down-volume days.
On Balance Volume BT_I_OBV indicator The On Balance Volume indicator calculates a running total of volume. Volume is added on up-days and subtracted on down days. The calculation is as follows:
Percentage Price Oscillator BT_I_PPO indicator Percentage Price Oscillator helps follow trends and has several uses.
Parabolic SAR BT_I_PSAR overlay The Parabolic SAR can help locate a reversal.
Positive Volume Index BT_I_PVI indicator Positive Volume Index is very similar to Negative Volume Index, but changes on volume-up days instead.
Qstick BT_I_QSTICK indicator Qstick can be used to quantify the ratio of recent up-bars to down-bars.
Rate of Change BT_I_ROC indicator The Rate of Change indicator calculates the change between the current price and the price ${\displaystyle n}$ bars ago.
Rate of Change Ratio BT_I_ROCR indicator The Rate of Change Ratio indicator calculates the change between the current price and the price ${\displaystyle n}$ bars ago.
Vector Round BT_I_ROUND simple Vector Round returns the closest integer for each element in the input array. Ties are resolved by taking the largest number.
Relative Strength Index BT_I_RSI indicator The Relative Strength Index is a momentum oscillator to help identify trends.
Vector Sine BT_I_SIN simple Calculates the Trigonometric sine.
Vector Hyperbolic Sine BT_I_SINH simple Calculates the Trigonometric hyperbolic sine.
Simple Moving Average BT_I_SMA overlay The Simple Moving Average is one of the most common smoothing functions used on time series data. It takes one parameter, the period ${\displaystyle n}$. Larger values for ${\displaystyle n}$ will have a greater smoothing effect on the input data but will also create more lag. It is calculated for each bar as the arithmetic mean of the previous ${\displaystyle n}$ bars.
Vector Square Root BT_I_SQRT simple Vector Square Root calculates the square root of each element in the input array.
Standard Deviation Over Period BT_I_STDDEV math The Standard Deviation Over Period indicator calculates the standard deviation of the input over a moving window.
Standard Error Over Period BT_I_STDERR math The Standard Error Over Period indicator calculates the standard error of the input mean over a moving window.
Stochastic Oscillator BT_I_STOCH indicator Work in progress
Stochastic RSI BT_I_STOCHRSI indicator The Stochastic RSI is a momentum oscillator to help identify trends.
Vector Subtraction BT_I_SUB simple Sub simply takes two input arrays and returns their difference.
Sum Over Period BT_I_SUM math The Sum Over Period indicator simply returns the sum of the last ${\displaystyle n}$ bars.
Vector Tangent BT_I_TAN simple Calculates the Trigonometric tangent.
Vector Hyperbolic Tangent BT_I_TANH simple Calculates the Trigonometric hyperbolic tangent.
Triple Exponential Moving Average BT_I_TEMA overlay The Triple Exponential Moving Average is similar to the Exponential Moving Average or the Double Exponential Moving Average, but provides even less lag. Triple Exponential Moving Average is probably best viewed as an extension of Double Exponential Moving Average.
Vector Degree Conversion BT_I_TODEG simple Vector Degree Conversion converts an input array of radians into an array of degrees.
True Range BT_I_TR indicator True range is a measure of volatility. It represents how much a security changed price on a given day. True range for each day is the greatest of:
• Day's high minus day's low
• The absolute value of the day's high minus the previous day's close
• The absolute value of the day's low minus the previous day's close
Triangular Moving Average BT_I_TRIMA overlay The Triangular Moving Average is similar to the Simple Moving Average but instead places more weight on middle portion of the smoothing period and less weight on the newest and oldest bars in the period. It takes one parameter, the period ${\displaystyle n}$. Larger values for ${\displaystyle n}$ will have a greater smoothing effect on the input data.
Trix BT_I_TRIX indicator The Trix is a momentum indicator. It takes one parameter, the period ${\displaystyle n}$. It is calculated as a rate of change of a Exponential Moving Average applied three times.
Vector Truncate BT_I_TRUNC simple Vector Truncate returns only the integer part of a number for each element in the input array. It is the same as Vector Floor for positive numbers and Vector Ceiling for negative numbers.
Time Series Forecast BT_I_TSF overlay The Time Series Forecast is a smoothing functions that works by preforming linear least squares regression over a moving window. It then uses the linear model to predict the value for the next bar. It takes one parameter, the period ${\displaystyle n}$. Larger values for ${\displaystyle n}$ will have a greater smoothing effect on the input data but will also create more lag.
Typical Price BT_I_TYPPRICE overlay The Typical Price calculates the arithmetic mean of the high, low, and close of a bar.
Ultimate Oscillator BT_I_ULTOSC indicator The Ultimate Oscillator is really a combination of three separate oscillators, each using a different smoothing period.
Variance Over Period BT_I_VAR math The Variance Over Period indicator calculates the variance of the input over a moving window.
Vertical Horizontal Filter BT_I_VHF indicator The Vertical Horizontal Filter indicator helps detect trends.
Variable Index Dynamic Average BT_I_VIDYA overlay The Variable Index Dynamic Average indicator modifies the Exponential Moving Average by varying the smoothness based on recent volatility.
Annualized Historical Volatility BT_I_VOLATILITY indicator The Annualized Historical Volatility indicator calculates the volatility over a moving window.
Volume Oscillator BT_I_VOSC indicator The Volume Oscillator displays the difference between two Simple Moving Average of a security's volume.
Volume Weighted Moving Average BT_I_VWMA overlay The Volume Weighted Moving Average is simalar to a Simple Moving Average, but it weights each bar by its volume.
Williams Accumulation/Distribution BT_I_WAD indicator Williams Accumulation/Distribution can help determine trend direction.
Weighted Close Price BT_I_WCPRICE overlay The weighted close price indicator calculates the mean of the high, low, and close of a bar, but the close price is weighted to count for double.
Wilders Smoothing BT_I_WILDERS overlay Wilder's smoothing is a type of exponential moving average. It takes one parameter, the period ${\displaystyle n}$, a positive integer. Larger values for ${\displaystyle n}$ will have a greater smoothing effect on the input data but will also create more lag.
Williams %R BT_I_WILLR indicator The Williams %R indicator measures momentum.
Weighted Moving Average BT_I_WMA overlay The Weighted Moving Average is similar to the Simple Moving Average but instead places more weight on more recent bars in the smoothing period and less weight on the oldest bars in the period. It takes one parameter, the period ${\displaystyle n}$. Larger values for ${\displaystyle n}$ will have a greater smoothing effect on the input data.
Zero-Lag Exponential Moving Average BT_I_ZLEMA overlay Zero-Lag Exponential Moving Average modifies a Exponential Moving Average to greatly reduce lag.