At the chart.php i've created a trick to optimize graph generation,
just turn on "$pular" and the graph is rendered discarding useless information..
but surely it would be better to generate the graph client side..
(I'm planing run HAL at my Pi too..)
About macd, finishing here..
thanks @yahma and @whydificult for the tips..
$control=(count($F1)*12)/100;
$control2=(count($F1)*1)/100;
$pular=false;
Will look into it. BTW, tried running it on my rasp-pi and it works for the most part (chart rendering is slow), except when the chart becomes longer than 1 day, then PHP hits the cpu limit time when rendering through pChart API. I might look into replacing the server side chart rendering with something client-side (ie. Javascript).