Location: PHPKode > projects > Finasystem > fs_ta/ll.php
<?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  
 */

/**
 * Lowest Low (LL)
 *
 *<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 ll{

	/**
	 * @var double
	 */
	private $ll;
	/**
	 * @var int
	 */
	private $index;
	
	/**
     * @param double[] $low
	 * @param int $idx_star
	 * @param int $range
	 * @return void
     */
	function set($low,$idx_start,$range){
		$this->ll = $low[$idx_start];
		$this->index = $idx_start;
		
		for ($i=$idx_start; $i<$range+$idx_start; $i++){
			if ($low[$i]<$this->ll){
				$this->ll = $low[$i];
				$this->index = $i;
			}
		}
	}
	
	/** 
     * @return double
     */
	function get_value(){
		return $this->ll;
	}
	/** 
     * @return int
     */
	function get_index(){
		return $this->index;
	}
}
?>
Return current item: Finasystem