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
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:
Copy
// 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:
Copy
$smaValue = $this->_sma->getValue($tradeContext->ohlcEntry);
Full example class:
Copy
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;
}
}
SDK Constants
Copy
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;
SDK Core Functions
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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
Copy
/**
* 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

