trader_adxr

(PECL trader >= 0.2.0)

trader_adxrAverage Directional Movement Index Rating

Description

array trader_adxr ( array $high , array $low , array $close [, integer $timePeriod ] )

Parameters

high

High price, array of real values.

low

Low price, array of real values.

close

Closing price, array of real values.

timePeriod

Number of period. Valid range from 2 to 100000.

Return Values

Returns an array with calculated data or false on failure.

Коментарии

<?php
// ADXR measures the difference in the change of momentum in the ADX.
// The ADXR is equal to the current ADX plus the ADX from n datapoints previous, divided by 2.

$highs = array(118.99119.14120.5115.23115.93118.829116112.2110.88110.19112.86112.11110.25112.44);
$lows = array(112.68115.26112.5110112.8113.61112.04108.71106.09103.1109.16106.77105107.67);
$closes = array(112.82117.32113.49112115.355115.54112.13110.34106.84110.08111.81107.12108.22112.28);

$time_period floor((count($highs)-2) / 2)-2;
                                     
var_dump(trader_adxr($highs$lows$closes$time_period));
/*
array(4) {
  [10]=>
  float(41.004)
  [11]=>
  float(44.783)
  [12]=>
  float(50.257)
  [13]=>
  float(43.597)
}
*/
2021-02-07 11:28:44
http://php5.kiev.ua/manual/ru/function.trader-adxr.html

    Поддержать сайт на родительском проекте КГБ