trader_cci

(PECL trader >= 0.2.0)

trader_cciCommodity Channel Index

Description

array trader_cci ( 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

// The CCI (Commodity Channel Index) is an oscillator that 
// relies on historical price momentum to determine if it is "overbought" or "oversold". 
// When greater than zero the price is "above" the historic average.
// When less than zero the price is "below" the historic average.
// Investopedia claims:
// "The CCI is an unbounded oscillator, meaning it can go higher or lower indefinitely. For this reason, overbought and oversold levels are typically determined for each individual asset by looking at historical extreme CCI levels where the price reversed from."

$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 7;

var_dump(trader_cci ($highs$lows$closes$time_period));
/*
array(8) {
  [6]=>
  float(-83.234)
  [7]=>
  float(-137.329)
  [8]=>
  float(-145.78)
  [9]=>
  float(-101.047)
  [10]=>
  float(-9.331)
  [11]=>
  float(-59.339)
  [12]=>
  float(-66.964)
  [13]=>
  float(76.143)
}
*/
2021-03-03 09:31:27
http://php5.kiev.ua/manual/ru/function.trader-cci.html

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