> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baibaibot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Technical Indicators

> Supported technical indicators used in technical analysis.

<img noZoom src="https://mintcdn.com/baibai/Q0FEDFNQDcX1j3TO/images/separator.jpg?fit=max&auto=format&n=Q0FEDFNQDcX1j3TO&q=85&s=5350c337aa3613424b48079d872b63e6" width="721" height="5" data-path="images/separator.jpg" />

<Tip>
  \| <a href="https://www.investopedia.com/terms/t/technicalindicator.asp" target="_blank">Learn more about technical indicators and how they are used in technical analysis.</a>
</Tip>

## Technical Indicators supported by the SDK

### Trend Indicators

* Minus Directional Indicator
* Minus Directional Movement
* Plus Directional Indicator
* Plus Directional Movement
* Average Directional Movement Index
* Average Directional Movement Index Rating
* Absolute Price Oscillator
* Aroon Oscillator
* Aroon Oscillator Values
* Directional Movement Index
* Moving Average Convergence/Divergence
* Extended MACD with additional parameters
* MACD with fixed parameters
* Money Flow Index
* Parabolic SAR
* Parabolic SAR (Extended)
* Time Series Forecast

### Oscillators

* Relative Strength Index
* Stochastic Oscillator
* Stochastic Fast Oscillator
* Stochastic RSI
* Williams' %R
* Chande Momentum Oscillator
* Percentage Price Oscillator
* Ultimate Oscillator

### Momentum Indicators

* Momentum
* Commodity Channel Index
* Rate of Change
* Rate of Change Percentage
* Rate of Change Ratio
* Rate of Change Ratio (scaled by 100)
* Balance Of Power

### Volume Indicators

* Accumulation/Distribution Line
* Accumulation/Distribution Oscillator
* On Balance Volume

### Volatility Indicators

* Bollinger Bands
* Average True Range
* Normalized Average True Range
* True Range

### Moving Averages

* Moving Average
* Moving Average with Variable Period
* Simple Moving Average
* Exponential Moving Average
* Weighted Moving Average
* Double Exponential Moving Average
* Triple Exponential Moving Average
* Triangular Moving Average
* Kaufman Adaptive Moving Average
* MESA Adaptive Moving Average
* Triple Exponential Moving Average (T3)
* 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA

### Cycle Indicators

* Hilbert Transform Dominant Cycle Period
* Hilbert Transform Dominant Cycle Phase
* Hilbert Transform Phasor Components
* Hilbert Transform SineWave

### Price Transformations

* Average Price
* Median Price
* Typical Price
* Weighted Close Price

### Statistical Functions

* Beta
* Pearson Correlation Coefficient
* Linear Regression
* Linear Regression Angle
* Linear Regression Intercept
* Linear Regression Slope
* Standard Deviation
* Variance

<img noZoom src="https://mintcdn.com/baibai/Q0FEDFNQDcX1j3TO/images/separator-small.png?fit=max&auto=format&n=Q0FEDFNQDcX1j3TO&q=85&s=8a26d422be09963b7e375935747563ae" width="721" height="1" data-path="images/separator-small.png" />

## SDK Classes

We provide wrapper classes for all technical indicators that are easy to use.

Here is an example that demonstrates how to use the SDK to calculate the Simple Moving Average (SMA):

#### Register the indicator(s) in the init function of your signal:

```php theme={null}
// Register the SMA indicator
$this->_sma = new IndicatorSMA(ParamValues::fromArray(["ohlcKey" => OHLCKeyType::Close, "timePeriod" => 9])));
$this->addIndicator("sma", $this->_sma);
```

#### Use the indicator(s) in the getSignalInfo function of your signal:

```php theme={null}
$smaValue = $this->_sma->getValue($tradeContext->ohlcEntry);
```

#### Full example class:

```php theme={null}
class SMAIndicatorExample extends UserTradeSignalBase
{
	private ?IndicatorSMA $_sma = null;

	protected function init(?ParamValues $params = null)
	{
		// Register the SMA indicator
		// NOTE: we could use the $params variable to pass the indicator's initial parameters instead of hardcoding them
        $this->_sma = new IndicatorSMA(ParamValues::fromArray(["ohlcKey" => OHLCKeyType::Close, "timePeriod" => 9]));
        $this->addIndicator("sma", $this->_sma);
	}

	function getSignalInfo(TradeContext $tradeContext):?TradeSignalInfo
	{
		$smaValue = $this->_sma->getValue($tradeContext->ohlcEntry);

		// TODO: do something with the value
		if ($smaValue > x)
			return new TradeSignalInfo(1, ["SMA" => $smaValue]);

		return null;
	}
}
```

<img noZoom src="https://mintcdn.com/baibai/Q0FEDFNQDcX1j3TO/images/separator-small.png?fit=max&auto=format&n=Q0FEDFNQDcX1j3TO&q=85&s=8a26d422be09963b7e375935747563ae" width="721" height="1" data-path="images/separator-small.png" />

## SDK Constants

```php theme={null}
    public static $MA_TYPE_SMA                   = 0;
    public static $MA_TYPE_EMA                   = 1;
    public static $MA_TYPE_WMA                   = 2;
    public static $MA_TYPE_DEMA                  = 3;
    public static $MA_TYPE_TEMA                  = 4;
    public static $MA_TYPE_TRIMA                 = 5;
    public static $MA_TYPE_KAMA                  = 6;
    public static $MA_TYPE_MAMA                  = 7;
    public static $MA_TYPE_T3                    = 8;
    public static $REAL_MIN                      = -3.0000000000000002E+37;
    public static $REAL_MAX                      = 3.0000000000000002E+37;
```

<img noZoom src="https://mintcdn.com/baibai/Q0FEDFNQDcX1j3TO/images/separator-small.png?fit=max&auto=format&n=Q0FEDFNQDcX1j3TO&q=85&s=8a26d422be09963b7e375935747563ae" width="721" height="1" data-path="images/separator-small.png" />

## SDK Core Functions

```php theme={null}
/**
 * Minus Directional Indicator
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_minus_di(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Minus Directional Movement
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_minus_dm(array $high, array $low, int $timePeriod = null):array
```

```php theme={null}
/**
 * Plus Directional Indicator
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_plus_di(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Plus Directional Movement
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_plus_dm(array $high, array $low, int $timePeriod = null):array
```

```php theme={null}
/**
 * Average Directional Movement Index
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_adx(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Average Directional Movement Index Rating
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_adxr(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Absolute Price Oscillator
 *
 * @param array $real       Array of real values.
 * @param ?int   $fastPeriod [OPTIONAL] [DEFAULT 12] Number of period for the fast MA. Valid range from 2 to 100000.
 * @param ?int   $slowPeriod [OPTIONAL] [DEFAULT 26] Number of period for the slow MA. Valid range from 2 to 100000.
 * @param ?int   $mAType     [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_apo(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null):array
```

```php theme={null}
/**
 * Aroon
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_aroon(array $high, array $low, int $timePeriod = null):array
```

```php theme={null}
/**
 * Aroon Oscillator
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_aroonosc(array $high, array $low, int $timePeriod = null):array
```

```php theme={null}
/**
 * Directional Movement Index
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array  Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_dx(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Moving Average Convergence/Divergence
 *
 * @param array $real         Array of real values.
 * @param ?int   $fastPeriod   [OPTIONAL] [DEFAULT 12] Number of period for the fast MA. Valid range from 2 to 100000.
 * @param ?int   $slowPeriod   [OPTIONAL] [DEFAULT 26] Number of period for the slow MA. Valid range from 2 to 100000.
 * @param ?int   $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_macd(array $real, int $fastPeriod = null, int $slowPeriod = null, int $signalPeriod = null):array
```

```php theme={null}
/**
 * Moving Average Convergence/Divergence with controllable Moving Average type
 *
 * @param array $real         Array of real values.
 * @param ?int   $fastPeriod   [OPTIONAL] [DEFAULT 12] Number of period for the fast MA. Valid range from 2 to 100000.
 * @param ?int   $fastMAType   [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for fast MA. MA_TYPE_* series of constants should be used.
 * @param ?int   $slowPeriod   [OPTIONAL] [DEFAULT 26] Number of period for the slow MA. Valid range from 2 to 100000.
 * @param ?int   $slowMAType   [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for fast MA. MA_TYPE_* series of constants should be used.
 * @param ?int   $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_macdext(array $real, int $fastPeriod = null, int $fastMAType = null, int $slowPeriod = null, int $slowMAType = null, int $signalPeriod = null):array
```

```php theme={null}
/**
 * Moving Average Convergence/Divergence Fix 12/26
 *
 * @param array $real         Array of real values.
 * @param ?int   $signalPeriod [OPTIONAL] [DEFAULT 9] Smoothing for the signal line (nb of period). Valid range from 1 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_macdfix(array $real, int $signalPeriod = null):array
```

```php theme={null}
/**
 * Money Flow Index
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param array $volume     Volume traded, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_mfi(array $high, array $low, array $close, array $volume, int $timePeriod = null):array
```

```php theme={null}
/**
 * Parabolic SAR
 *
 * @param array $high         High price, array of real values.
 * @param array $low          Low price, array of real values.
 * @param ?float $acceleration [OPTIONAL] [DEFAULT 0.02] Acceleration Factor used up to the Maximum value. Valid range from 0 to REAL_MAX.
 * @param ?float $maximum      [OPTIONAL] [DEFAULT 0.2] Acceleration Factor Maximum value. Valid range from 0 to REAL_MAX.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_sar(array $high, array $low, float $acceleration = null, float $maximum = null):array
```

```php theme={null}
/**
 * Parabolic SAR - Extended
 *
 * @param array $high                  High price, array of real values.
 * @param array $low                   Low price, array of real values.
 * @param ?float $startValue            [OPTIONAL] [DEFAULT 0.0] Start value and direction. 0 for Auto, >0 for Long, <0 for Short. Valid range from REAL_MIN to REAL_MAX.
 * @param ?float $offsetOnReverse       [OPTIONAL] [DEFAULT 0.0] Percent offset added/removed to initial stop on short/long reversal. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationInitLong  [OPTIONAL] [DEFAULT 0.02] Acceleration Factor initial value for the Long direction. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationLong      [OPTIONAL] [DEFAULT 0.02] Acceleration Factor for the Long direction. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationMaxLong   [OPTIONAL] [DEFAULT 0.2] Acceleration Factor maximum value for the Long direction. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationInitShort [OPTIONAL] [DEFAULT 0.02] Acceleration Factor initial value for the Short direction. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationShort     [OPTIONAL] [DEFAULT 0.02] Acceleration Factor for the Short direction. Valid range from 0 to REAL_MAX.
 * @param ?float $accelerationMaxShort  [OPTIONAL] [DEFAULT 0.2] Acceleration Factor maximum value for the Short direction. Valid range from 0 to REAL_MAX.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_sarext(array $high, array $low, float $startValue = null, float $offsetOnReverse = null, float $accelerationInitLong = null, float $accelerationLong = null, float $accelerationMaxLong = null, float $accelerationInitShort = null, float $accelerationShort = null, float $accelerationMaxShort = null):array
```

```php theme={null}
/**
 * Time Series Forecast
 *
 * @param array $real     Array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_tsf(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Relative Strength Index
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_rsi(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Stochastic
 *
 * @param array $high         High price, array of real values.
 * @param array $low          Low price, array of real values.
 * @param array $close        Time period for building the Fast-K line. Valid range from 1 to 100000.
 * @param ?int   $fastK_Period [OPTIONAL] [DEFAULT 5] Time period for building the Fast-K line. Valid range from 1 to 100000.
 * @param ?int   $slowK_Period [OPTIONAL] [DEFAULT 3] Smoothing for making the Slow-K line. Valid range from 1 to 100000, usually set to 3.
 * @param ?int   $slowK_MAType [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for Slow-K. MA_TYPE_* series of constants should be used.
 * @param ?int   $slowD_Period [OPTIONAL] [DEFAULT 3] Smoothing for making the Slow-D line. Valid range from 1 to 100000.
 * @param ?int   $slowD_MAType [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for Slow-D. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_stoch(array $high, array $low, array $close, int $fastK_Period = null, int $slowK_Period = null, int $slowK_MAType = null, int $slowD_Period = null, int $slowD_MAType = null):array
```

```php theme={null}
/**
 * Stochastic Fast
 *
 * @param array $high         High price, array of real values.
 * @param array $low          Low price, array of real values.
 * @param array $close        Time period for building the Fast-K line. Valid range from 1 to 100000.
 * @param ?int   $fastK_Period [OPTIONAL] [DEFAULT 5] Time period for building the Fast-K line. Valid range from 1 to 100000.
 * @param ?int   $fastD_Period [OPTIONAL] [DEFAULT 3] Smoothing for making the Fast-D line. Valid range from 1 to 100000, usually set to 3.
 * @param ?int   $fastD_MAType [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for Fast-D. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_stochf(array $high, array $low, array $close, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null):array
```

```php theme={null}
/**
 * Stochastic Relative Strength Index
 *
 * @param array $real         Array of real values.
 * @param ?int   $timePeriod   [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 * @param ?int   $fastK_Period [OPTIONAL] [DEFAULT 5] Time period for building the Fast-K line. Valid range from 1 to 100000.
 * @param ?int   $fastD_Period [OPTIONAL] [DEFAULT 3] Smoothing for making the Fast-D line. Valid range from 1 to 100000, usually set to 3.
 * @param ?int   $fastD_MAType [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average for Fast-D. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_stochrsi(array $real, int $timePeriod = null, int $fastK_Period = null, int $fastD_Period = null, int $fastD_MAType = null):array
```

```php theme={null}
/**
 * Williams' %R
 *
 * @param array $high     High price, array of real values.
 * @param array $low      Low price, array of real values.
 * @param array $close    Closing price, array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_willr(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Chande Momentum Oscillator
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_cmo(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Percentage Price Oscillator
 *
 * @param array $real       Array of real values.
 * @param ?int   $fastPeriod [OPTIONAL] [DEFAULT 12] Number of period for the fast MA. Valid range from 2 to 100000.
 * @param ?int   $slowPeriod [OPTIONAL] [DEFAULT 26] Number of period for the slow MA. Valid range from 2 to 100000.
 * @param ?int   $mAType     [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ppo(array $real, int $fastPeriod = null, int $slowPeriod = null, int $mAType = null):array
```

```php theme={null}
/**
 * Ultimate Oscillator
 *
 * @param array $high      High price, array of real values.
 * @param array $low       Low price, array of real values.
 * @param array $close     Closing price, array of real values.
 * @param ?int $timePeriod1 [OPTIONAL] [DEFAULT 7] Number of bars for 1st period. Valid range from 1 to 100000.
 * @param ?int $timePeriod2 [OPTIONAL] [DEFAULT 14] Number of bars for 2nd period. Valid range from 1 to 100000.
 * @param ?int $timePeriod3 [OPTIONAL] [DEFAULT 28] Number of bars for 3rd period. Valid range from 1 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ultosc(array $high, array $low, array $close, int $timePeriod1 = null, int $timePeriod2 = null, int $timePeriod3 = null):array
```

```php theme={null}
/**
 * Momentum
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_mom(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Commodity Channel Index
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_cci(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Rate of change : ((price/prevPrice)-1)*100
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_roc(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Rate of change Percentage: (price-prevPrice)/prevPrice
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_rocp(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Rate of change ratio: (price/prevPrice)
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_rocr(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Rate of change ratio 100 scale: (price/prevPrice)*100
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 10] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_rocr100(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Balance Of Power
 *
 * @param array $open  Opening price, array of real values.
 * @param array $high  High price, array of real values.
 * @param array $low   Low price, array of real values.
 * @param array $close Closing price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_bop(array $open, array $high, array $low, array $close):array
```

```php theme={null}
/**
 * Chaikin A/D Line
 *
 * @param array $high   High price, array of real values.
 * @param array $low    Low price, array of real values.
 * @param array $close  Closing price, array of real values.
 * @param array $volume Volume traded, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ad(array $high, array $low, array $close, array $volume):array
```

```php theme={null}
/**
 * Chaikin A/D Oscillator
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param array $volume     Volume traded, array of real values.
 * @param ?int   $fastPeriod [OPTIONAL] [DEFAULT 3] Number of period for the fast MA. Valid range from 2 to 100000.
 * @param ?int   $slowPeriod [OPTIONAL] [DEFAULT 10] Number of period for the slow MA. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_adosc(array $high, array $low, array $close, array $volume, int $fastPeriod = null, int $slowPeriod = null):array
```

```php theme={null}
/**
 * On Balance Volume
 *
 * @param array $real   Array of real values.
 * @param array $volume Volume traded, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_obv(array $real, array $volume):array
```

```php theme={null}
/**
 * Bollinger Bands
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000.
 * @param ?float $nbDevUp    [OPTIONAL] [DEFAULT 2.0] Deviation multiplier for upper band. Valid range from REAL_MIN to REAL_MAX.
 * @param ?float $nbDevDn    [OPTIONAL] [DEFAULT 2.0] Deviation multiplier for lower band. Valid range from REAL_MIN to REAL_MAX.
 * @param ?int   $mAType     [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_bbands(array $real, int $timePeriod = null, float $nbDevUp = null, float $nbDevDn = null, int $mAType = null):array
```

```php theme={null}
/**
 * Average True Range
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_atr(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * Normalized Average True Range
 *
 * @param array $high       High price, array of real values.
 * @param array $low        Low price, array of real values.
 * @param array $close      Closing price, array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_natr(array $high, array $low, array $close, int $timePeriod = null):array
```

```php theme={null}
/**
 * True Range
 *
 * @param array $high  High price, array of real values.
 * @param array $low   Low price, array of real values.
 * @param array $close Closing price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_trange(array $high, array $low, array $close):array
```

```php theme={null}
/**
 * Moving average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 * @param ?int   $mAType     [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ma(array $real, int $timePeriod = null, int $mAType = null):array
```

```php theme={null}
/**
 * Moving average with variable period
 *
 * @param array $real      Array of real values.
 * @param array $periods   Array of real values.
 * @param ?int   $minPeriod [OPTIONAL] [DEFAULT 2] Value less than minimum will be changed to Minimum period. Valid range from 2 to 100000
 * @param ?int   $maxPeriod [OPTIONAL] [DEFAULT 30] Value higher than maximum will be changed to Maximum period. Valid range from 2 to 100000
 * @param ?int   $mAType    [OPTIONAL] [DEFAULT MA_TYPE_SMA] Type of Moving Average. MA_TYPE_* series of constants should be used.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_mavp(array $real, array $periods, int $minPeriod = null, int $maxPeriod = null, int $mAType = null):array
```

```php theme={null}
/**
 * Simple Moving Average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_sma(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Exponential Moving Average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ema(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Weighted Moving Average
 *
 * @param array $real     Array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_wma(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Double Exponential Moving Average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_dema(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Triple Exponential Moving Average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_tema(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Triangular Moving Average
 *
 * @param array $real     Array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_trima(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Kaufman Adaptive Moving Average
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_kama(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * MESA Adaptive Moving Average
 *
 * @param array $real      Array of real values.
 * @param ?float $fastLimit [OPTIONAL] [DEFAULT 0.5] Upper limit use in the adaptive algorithm. Valid range from 0.01 to 0.99.
 * @param ?float $slowLimit [OPTIONAL] [DEFAULT 0.05] Lower limit use in the adaptive algorithm. Valid range from 0.01 to 0.99.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_mama(array $real, float $fastLimit = null, float $slowLimit = null):array
```

```php theme={null}
/**
 * Triple Exponential Moving Average (T3)
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000.
 * @param ?float $vFactor    [OPTIONAL] [DEFAULT 0.7] Volume Factor. Valid range from 1 to 0.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_t3(array $real, int $timePeriod = null, float $vFactor = null):array
```

```php theme={null}
/**
 * 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
 *
 * @param array $real     Array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_trix(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Hilbert Transform - Dominant Cycle Period
 *
 * @param array $real Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_dcperiod(array $real):array
```

```php theme={null}
/**
 * Hilbert Transform - Dominant Cycle Phase
 *
 * @param array $real Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_dcphase(array $real):array
```

```php theme={null}
/**
 * Hilbert Transform - Phasor Components
 *
 * @param array $real    Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_phasor(array $real):array
```

```php theme={null}
/**
 * Hilbert Transform - SineWave
 *
 * @param array $real Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_sine(array $real):array
```

```php theme={null}
/**
 * Hilbert Transform - Instantaneous Trendline
 *
 * @param array $real Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_trendline(array $real):array
```

```php theme={null}
/**
 * Hilbert Transform - Trend vs Cycle Mode
 *
 * @param array $real Array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_ht_trendmode(array $real):array
```

```php theme={null}
/**
 * Average Price
 *
 * @param array $open  Opening price, array of real values.
 * @param array $high  High price, array of real values.
 * @param array $low   Low price, array of real values.
 * @param array $close Closing price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_avgprice(array $open, array $high, array $low, array $close):array
```

```php theme={null}
/**
 * Median Price
 *
 * @param array $high High price, array of real values.
 * @param array $low  Low price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_medprice(array $high, array $low):array
```

```php theme={null}
/**
 * Typical Price
 *
 * @param array $high  High price, array of real values.
 * @param array $low   Low price, array of real values.
 * @param array $close Closing price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_typprice(array $high, array $low, array $close):array
```

```php theme={null}
/**
 * Weighted Close Price
 *
 * @param array $high  High price, array of real values.
 * @param array $low   Low price, array of real values.
 * @param array $close Closing price, array of real values.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_wclprice(array $high, array $low, array $close):array
```

```php theme={null}
/**
 * Beta
 *
 * @param array $real0      Array of real values.
 * @param array $real1      Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_beta(array $real0, array $real1, int $timePeriod = null):array
```

```php theme={null}
/**
 * Pearson's Correlation Coefficient (r)
 *
 * @param array $real0      Array of real values.
 * @param array $real1      Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 30] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_correl(array $real0, array $real1, int $timePeriod = null):array
```

```php theme={null}
/**
 * Linear Regression Angle
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_linearreg_angle(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Linear Regression Angle
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_linearreg_intercept(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Linear Regression Slope
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_linearreg_slope(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Linear Regression
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 14] Number of period. Valid range from 2 to 100000.
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_linearreg(array $real, int $timePeriod = null):array
```

```php theme={null}
/**
 * Standard Deviation
 *
 * @param array $real       Array of real values.
 * @param ?int   $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000.
 * @param ?float $nbDev      [OPTIONAL] [DEFAULT 1.0] Number of deviations
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_stddev(array $real, int $timePeriod = null, float $nbDev = null):array
```

```php theme={null}
/**
 * Variance
 *
 * @param array $real     Array of real values.
 * @param ?int $timePeriod [OPTIONAL] [DEFAULT 5] Number of period. Valid range from 2 to 100000.
 * @param ?float $nbDev    [OPTIONAL] [DEFAULT 1.0] Number of deviations
 *
 * @return array Returns an array with calculated data or false on failure.
 * @throws Exception
 */
bb_var(array $real, int $timePeriod = null, float $nbDev = null):array
```
