What is the meaning of the values ​​returned by trader_bbands ()?

I am using a trader php library .

I am using the function trader_bbands()

$bBand = trader_bbands( $NumberArray,
                        25,
                        TRADER_REAL_MIN,
                        TRADER_REAL_MIN,
                        TRADER_MA_TYPE_EMA
                        );

It returns three arrays.

$bBand[0]; // upper-edge of the Bollinger Band           ( an upline )
$bBand[1]; //  central line the Bollinger Bands surround ( a moving average )
$bBand[2]; // lower-edge of the Bollinger Band           ( a downline )

My initial values $NumberArrayare around2000.0

$bBand[1] is a simple moving average, so it returns numbers around 2000.

However, $bBand[0]they $bBand[2]return values ​​as shown below (example given in var_dump())

  double(3.1325286910105E+38)
  [105] =>
  double(3.1907365920756E+38)
  [106] =>
  double(3.1907365920756E+38)
  [107] =>
  double(3.1740850650235E+38)
  [108] =>
  double(3.1498571396175E+38)

Q1: What does this array mean?

What I expect from the Bollinger Band is around 2000 + α, or 2000 - α, though.

+4
source share
1 answer

A1:
1. php- trader_bbands(), .
2. MCVE -altogether-with-a- DataSET, DataSET
3. , {PASS | FAIL} - Trader php-library.

1.:
array trader_bbands ( array $real [, integer $timePeriod [, float $nbDevUp [, float $nbDevDn [, integer $mAType ]]]] )

$nbDevUp = 1.0, float TRADER_REAL_MIN
$nbDevDn = 1.0.

, $timePeriod = 7

$real

$real = array(
               0 => 2000.0,
               1 => 2001.0,
               2 => 2002.0,
               3 => 2003.0,
               4 => 2004.0,
               5 => 2005.0,
               6 => 2006.0,
               );

:

.std() -sigma , , Trader php-library trader_bbands(), TRADER_MA_TYPE_EMA, - , , enter image description here

A). , $bBand[0][i] - $bBand[1][i] == $bBand[1][i] - $bBand[2][i] == 2.0

B) , .ewma() -, - Trader php-.

, , , $bBand[1]. Trader php-library , Quant, ewmaEXP = 2.0 / ( timePeriod + 1 ).

+3

Source: https://habr.com/ru/post/1662277/


All Articles