本文整理汇总了PHP中Portfolio::getNumClosedTrades方法的典型用法代码示例。如果您正苦于以下问题:PHP Portfolio::getNumClosedTrades方法的具体用法?PHP Portfolio::getNumClosedTrades怎么用?PHP Portfolio::getNumClosedTrades使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Portfolio
的用法示例。
在下文中一共展示了Portfolio::getNumClosedTrades方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_portfolio_list
/**
* Will return an HTML formatted list of all portfolio's in our system.
*/
function get_portfolio_list()
{
$portfolioTable = '
<table class="table" width="720" cellspacing="0">
<tr>
<td width="75" class="table_header"><b>Name</b></td>
<td width="60" class="table_header"><b>Open Trades</b></td>
<td width="60" class="table_header"><b>Closed Trades</b></td>
<td width="60" class="table_header"><b>Opening Capital</b></td>
<td width="60" class="table_header"><b>Account Value</b></td>
<td width="60" class="table_header"><b>Current Cash</b></td>
<td width="60" class="table_header"><b>Net Gain/Loss</b></td>
</tr>';
$query = mysql_query("SELECT * FROM portfolio ORDER BY name ASC");
while ($array = mysql_fetch_array($query)) {
$portfolio = new Portfolio($array);
$portfolio->runCapitalReport();
$portfolioTable .= '
<tr>
<td width="75" class="table_row"><a href="portfolio.php?portfolio_id=' . $portfolio->id . '">' . $portfolio->name . '</a></td>
<td width="60" class="table_row">' . $portfolio->getNumOpenTrades() . '</td>
<td width="60" class="table_row">' . $portfolio->getNumClosedTrades() . '</td>
<td width="60" class="table_row">$' . round($portfolio->opening_capital, 2) . '</td>
<td width="60" class="table_row">$' . round($portfolio->account_value, 2) . '</td>
<td width="60" class="table_row">$' . round($portfolio->current_cash, 2) . '</td>
<td width="60" class="table_row">$' . round($portfolio->account_value - $portfolio->opening_capital, 2) . '</td>
</tr>
';
}
$portfolioTable .= '</table>';
return $portfolioTable;
}