Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
Overlap Studies
talib.ACCBANDS
talib.BBANDS
talib.DEMA
talib.EMA
talib.HT_TRENDLINE
talib.KAMA
talib.MA
talib.MAMA
talib.MAVP
talib.MIDPOINT
talib.MIDPRICE
talib.SAR
talib.SAREXT
talib.SMA
talib.T3
talib.TEMA
talib.TRIMA
talib.WMA
Momentum Indicators
Volume Indicators
Volatility Indicators
Cycle Indicators
Price Transform
Statistic Functions
Math Transform
Math Operators
Pattern Recognition
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Calculates the Acceleration Bands and returns the upper band, middle band and lower band.

talib.ACCBANDS(inPriceHLC)
talib.ACCBANDS(inPriceHLC, optInTimePeriod)

Examples

Compute the Acceleration Bands from the latest K-lines.

javascript
function main() { var records = exchange.GetRecords() if (!records) return var ret = talib.ACCBANDS(records) // Output: [upper band array, middle band array, lower band array] Log(ret) }
python
import talib def main(): records = exchange.GetRecords() if not records: return upper, middle, lower = talib.ACCBANDS(records.High, records.Low, records.Close) # Output: (upper band array, middle band array, lower band array) Log(upper, middle, lower)

Returns

TypeDescription

array

Two-dimensional array: [upper band array, middle band array, lower band array] (a tuple in the same order in Python).

Arguments

NameTypeRequiredDescription

inPriceHLC

Record array

Yes

K-line array; the high, low and close fields are used. In Python, pass records.High, records.Low, records.Close in this order.

optInTimePeriod

number

No

Calculation period. Default 20.

See Also

Remarks

TA-Lib equivalent: ACCBANDS(Records[High,Low,Close],Time Period = 20) = [Array(outRealUpperBand),Array(outRealMiddleBand),Array(outRealLowerBand)].

The upper band is the simple moving average of High * (1 + 4 * (High - Low) / (High + Low)), the middle band is the simple moving average of the close price, and the lower band is the simple moving average of Low * (1 - 4 * (High - Low) / (High + Low)), all over optInTimePeriod bars.

In Python, TA-Lib provides this function from version 0.6 (both the C library and the Python package must be 0.6 or later); older versions raise an attribute error.