public static function addStochInfoAndCreate($ticker, $tid) { $parts = finance_google::retrieveSlowDAndParts($ticker); echo "\nUpdating history for " . $ticker . " TID:" . $tid; $tickerHistory = new ticker_history(); $tickerHistory->set_variable('history_price', $parts['last']); $date = date("Y-m-d h:i:s", $parts['date']); $tickerHistory->set_variable('history_date', $date); $tickerHistory->set_variable('history_ticker_id', $tid); $tickerHistory->set_variable('history_lasthigh', $parts['high']); $tickerHistory->set_variable('history_lastlow', $parts['low']); $tickerHistory->set_variable('history_r1', $parts['r1']); $tickerHistory->set_variable('history_r2', $parts['r2']); $tickerHistory->set_variable('history_fastk', $parts['fastK']); $tickerHistory->set_variable('history_slowk', $parts['slowK']); $tickerHistory->set_variable('history_slowd', $parts['slowD']); $tickerHistory->createNew(); }