getHoldingsReturn; } } ?> WSF/PHP StockTrader Welcome
Trade Alert: The following orders have completed.

"); print(""); $index = 0; while ($getClosedOrdersReturn->OrderDataBean[$index]) { $openDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->openDate); $completionDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->completionDate); print (""); $index ++; } print("
Order IDOrder StatusCreation DateCompletion Date Txn FeeTypeSymbolQuantity
".$getClosedOrdersReturn->OrderDataBean[$index]->orderID." ".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus." ".$openDate->format("m/d/Y h:i:s A")." ".$completionDate->format("m/d/Y h:i:s A")." $".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee." ".$getClosedOrdersReturn->OrderDataBean[$index]->orderType." ".$getClosedOrdersReturn->OrderDataBean[$index]->symbol." ".$getClosedOrdersReturn->OrderDataBean[$index]->quantity."


"); } if ($holdingsReturn) { print ("

Portfolio Information

"); print (""); $index = 0; $purchaseBasis = 0; $marketValue = 0; $gain = 0; while ($holdingsReturn->HoldingDataBean[$index]) { $bean = $holdingsReturn->HoldingDataBean[$index]; if (!$quoteInfo[$bean->quoteID]) { $quotes = GetQuote($bean->quoteID); if ($quotes) $quotesReturn = $quotes->getQuoteReturn; $quoteInfo[$bean->quoteID] = $quotesReturn->price; } $purchaseBasis = $purchaseBasis + ($bean->purchasePrice) * ($bean->quantity); $marketValue = $marketValue + ($quoteInfo[$bean->quoteID]) * ($bean->quantity); $gain = ($quoteInfo[$bean->quoteID] - $bean->purchasePrice) * ($bean->quantity); $dateTime = new DateTime($bean->purchaseDate); print(""); $index ++; } print (""); } else if ($gain > 0) { print ("$".$gain.""); } else { print ("$".$gain.""); } print ("
Holding IDPurchase DateSymbol QuantityPurchase PriceCurrent Price Purchase BasisMarket ValueGain(Loss) Trade
".$bean->holdingID."".$dateTime->format("m/d/Y h:i:s A")."
quoteID."\"/> quoteID."\">
".$bean->quantity."$" .$bean->purchasePrice."$".$quoteInfo[$bean->quoteID]."$". (($bean->purchasePrice) * ($bean->quantity))."$".($quoteInfo[$bean->quoteID] * ($bean->quantity)). ""); if ($gain > 0) { print ("".$gain.""); } else if ($gain < 0) { print ("".$gain.""); } else { print ("".$gain.""); } print(""); print("
"); print("holdingID."\">"); print("quantity."\">"); print("quoteID."\">"); print(""); print("
Totals$".$purchaseBasis. "$".$marketValue.""); $gain = $marketValue - $purchaseBasis; if ($gain < 0) { print ("$".$gain."
"); } ?>