<?php
/**
* Finasystem version 0.4 Lin Hai - Technical Analysis Library in PHP
*Release: 14/10/2006
*Copyright (C) 2006 Rudy Zuck
*mailto:rudy[-at-]zuck.fr
*web:http://sourceforge.net/projects/finasystem
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* Highest High (hh)
*
*<p>The Highest High corresponds to the highest value in a -n- specified range.
*It is not a Technical Analysis Indocator but is used to build other indicators. The method
*get_value returns the highest value found whereas the method get_index returns the index number of the
*array where the highest value was found</p>
*
*
* @author Rudy Zuck <rudy[-at-]zuck.fr>
* @copyright Copyright, 2006, Rudy Zuck
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version 0.4
* @package fs_ta
*/
class hh{
/**
* @var double
*/
private $hh;
/**
* @var int
*/
private $index;
/**
* @param double[] $high
* @param int $idx_start
* @param int $range
* @return void
*/
function set($high,$idx_start,$range){
//Initialization
$this->hh = $high[$idx_start];
$this->index = $idx_start;
for ($i=$idx_start; $i<$range+$idx_start; $i++){
if ($high[$i]>$this->hh){
$this->hh = $high[$i];
$this->index = $i;
}
}
}
/**
* @return double
*/
function get_value(){
return $this->hh;
}
/**
* @return int
*/
function get_index(){
return $this->index;
}
}
?>