$open= $arr[3];$high=$arr[4];$low=$arr[5];$close=$arr[6]; Then I do some calculations using these: The chunk of the code that does the calculation is: if ($close<$open) { $stretch=(($high*100)-($open*100)); $stretcher=(($open*100)-($low*100)); $identifier="Red"; } if ($close>$open) { $stretch=(($open*100)-($low*100)); $stretcher= (($high*100)-($open*100)); $identifier="Green"; } if ($close==$open) { $stretch=(($high*100)-($open*100)); $stretcher=(($open*100)-($low*100)); $identifier="Doji"; } print "$date $time1 $time2 $stretch $stretcher $identifier $open $high $low $close\n";