Piotroski Scores

$password=”dbadminpw”;
$database=”findata”;

mysql_pconnect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);
$query=”select piotroski_scores.ticker,tickerlist.coname,tickerlist.sector,piotroski_scores.currency,tickerlist.mktcap,piotroski_scores.period_end_date,piotroski_scores.curr_qtr,piotroski_scores.prev_qtr,piotroski_scores.pio,piotroski_scores.found,tickerlist.exchange,tickerlist.lastprice,tickerlist.volume,tickerlist.avgvol,tickerlist.eps,tickerlist.peratio,tickerlist.pbook from piotroski_scores,tickerlist where tickerlist.msnticker=piotroski_scores.msnticker and piotroski_scores.pio>=7 order by found desc, pio desc limit 600″;

$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

// Tooltips for Table Header
echo ‘

Ticker.

‘;
echo ‘

Company Name.

‘;
echo ‘

Sector.

‘;
echo ‘

Reporting Currency.

‘;
echo ‘

Stock Exchange.

‘;
echo ‘

Market Capitalization.

‘;
echo ‘

Period End Date.

‘;
echo ‘

Current Quarter for Piotroski Score Comparison.

‘;
echo ‘

Prevous Quarter for Piotroski Score Comparison.

‘;
echo ‘

Piotroski Score (0-9).

‘;
echo ‘

Number of valid items found in calculation of Piotroski Score (0-9).

‘;
echo ‘

Last Closing Price.

‘;
echo ‘

Volume.

‘;
echo ‘

Average Daily Volume.

‘;
echo ‘

Earnings Per Share.

‘;
echo ‘

Price/Earnings Ratio.

‘;
echo ‘

Price/Book Value.

‘;

echo ‘

Ranking of Piotroski F-Scores

‘;

echo ‘

Note: Table is sortable by clicking on the column headers. Mouse over Price (most recent month end price is shown) to get current price.

‘;
echo ‘

This table lists Piotroski F-Scores for many Common Stocks by Rank, starting with those scoring highest and with the highest number of valid items found (9 being the maximum Piotroski Score). Due to popular request, Price/Book is included – where it shows “N/A”, no data was found or the company has a negative book value. For more on this calculation, see: The Piotroski Score. Professor Joseph D. Piotroski is now Associate Professor at The Stanford Graduate School of Business. His original article can be found at Value Investing: The Use of Historical Financial Statement Information to Separate Winners from Losers. Want to find the Piotroski Score for other stocks? Go to our Quotes page. (Piotroski Scores not working as of June 2015. Will fix.)

‘;

echo ‘



‘;

echo ‘

‘;

echo ‘

‘;

echo ‘
‘; echo ”; echo ‘TickerCompany NameSectorCurrencyExchangeMkt CapPeriod EndCurr QtrPrev QtrPiotroskiItems FoundLast CloseVolumeAverage VolumeEPSP/EP/Book‘;echo ‘

‘;
$i=0;
while ($i < $num) {
echo ‘
‘; echo ”;
$ticker=mysql_result($result,$i,”piotroski_scores.ticker”);
$coname=mysql_result($result,$i,”tickerlist.coname”);
$sector=mysql_result($result,$i,”tickerlist.sector”);
$currency=mysql_result($result,$i,”piotroski_scores.currency”);
$exchange=mysql_result($result,$i,”tickerlist.exchange”);
$mktcap=mysql_result($result,$i,”tickerlist.mktcap”);
$periodend=mysql_result($result,$i,”piotroski_scores.period_end_date”);
$curr_qtr=mysql_result($result,$i,”piotroski_scores.curr_qtr”);
$prev_qtr=mysql_result($result,$i,”piotroski_scores.prev_qtr”);
$pio=mysql_result($result,$i,”piotroski_scores.pio”);
$found=mysql_result($result,$i,”piotroski_scores.found”);
$lastprice=mysql_result($result,$i,”tickerlist.lastprice”);
$volume=mysql_result($result,$i,”tickerlist.volume”);
$avgvol=mysql_result($result,$i,”tickerlist.avgvol”);
$eps=mysql_result($result,$i,”tickerlist.eps”);
$peratio=mysql_result($result,$i,”tickerlist.peratio”);
$pbook=mysql_result($result,$i,”tickerlist.pbook”);

if ($pbook == 0) {
$pbook = “N/A”;
}

echo ‘‘;
echo “$ticker”;
echo ‘

‘;
echo “$coname

“;
echo “$sector

“;
echo “” . strtoupper($currency) . “

“;
echo “$exchange

“;
echo “$mktcap

“;
echo “$periodend

“;
echo “$curr_qtr

“;
echo “$prev_qtr

“;
echo “$pio

“;
echo “$found

“;
if ($exchange == “London”) {
echo ‘‘.$lastprice.’

‘;
} elseif ($exchange == “XETRA”) {
echo ‘‘.$lastprice.’

‘;
} elseif ($exchange == “Paris”) {
echo ‘‘.$lastprice.’

‘;
} elseif ($exchange == “ASX”) {
echo ‘AU$’.$lastprice.’

‘;
} else {
echo ‘$’.$lastprice.’

‘;
}
echo “$volume

“;
echo “$avgvol

“;
echo “$eps

“;
echo “$peratio

“;
echo “$pbook

“;

$i++;
}
echo ”

“;
echo ”

“;

?>