D
D
Denis Dormadekhin2018-04-12 15:03:57
PHP
Denis Dormadekhin, 2018-04-12 15:03:57

How to use trader_bbands in php?

There was a need to calculate the value of Bollinger Bands on php
There are vds on Ubuntu, php7.2 is
installed there, installed the Trader extension for php and added the extension to php.ini
The result of the trader_bbands function is three arrays, which are the calculated values ​​of Bollinger
Bands all three arrays are the same, what could be the problem?
input array:

$arValues = [
  0 => 0.0017875
  1 => 0.001791
  2 => 0.0017904
  3 => 0.0017912
  4 => 0.001783
  5 => 0.0017821
  6 => 0.0017821
  7 => 0.001783
  8 => 0.0017888
  9 => 0.0017871
  10 => 0.0017877
  11 => 0.0017883
  12 => 0.0017869
  13 => 0.001783
  14 => 0.0017866
  15 => 0.0017879
  16 => 0.0017911
  17 => 0.0017936
  18 => 0.0017896
  19 => 0.0017902
  20 => 0.0017839
  21 => 0.0017818
  22 => 0.0017835
  23 => 0.0017836
  24 => 0.0017831
  25 => 0.0017832
  26 => 0.0017812
  27 => 0.0017816
  28 => 0.0017819
  29 => 0.0017803
]

function call: Result:
$bol = trader_bbands($arValues, 30, 2.0, 2.0);
$bol = [
  0 => [
    29 => 0.0017858
  ]
  1 => [
    29 => 0.0017858
  ]
  2 => [
    29 => 0.0017858
  ]
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
leni_m, 2018-04-12
@leni_m

If a function returns something wrong to you, then there is a problem with it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question