% # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. %> <% # Checking whether there is new status change happened in the # related to a particular order. if (@closedOrders != nil) %>
Trade Alert: The following orders have completed.
Order ID | Order Status | Creation Date | Completion Date | Txn Fee | Type | Symbol | Quantity |
---|---|---|---|---|---|---|---|
<%=order["orderID"]%> | <%=order["orderStatus"]%> | <%=openDate%> | <%=completionDate%> | $<%=order["orderFee"]%> | <%=order["orderType"]%> | <%=order["symbol"]%> | <%=order["quantity"]%> |
<%=order["orderID"]%> | <%=order["orderStatus"]%> | <%=openDate%> | <%=completionDate%> | $<%=order["orderFee"]%> | <%=order["orderType"]%> | <%=order["symbol"]%> | <%=order["quantity"]%> |
Holding ID | Purchase Date | Symbol | Quantity | Purchase Price | Current Price | Purchase Basis | Market Value | Gain(Loss) | Trade |
---|---|---|---|---|---|---|---|---|---|
<%=bean["holdingID"]%> | <%=bean["quantity"]%> | $<%=bean["purchasePrice"]%> | $<%=@quoteInfo[quoteID]%> | $<%="%.2f" % ((bean["purchasePrice"].to_f) * (bean["quantity"].to_i))%> | $<%="%.2f" % (@quoteInfo[quoteID].to_f * bean["quantity"].to_i)%> | <% if (gain > 0) %> $<%="%.2f" % gain%> <% elsif (gain < 0) gain = gain * -1 %> $<%="%.2f" % gain%> <% else %> $<%="%.2f" % gain%> <% end %> | |||
Totals | $<%=purchaseBasis%> | $<%=marketValue%> | <% gain = marketValue - purchaseBasis if (gain < 0) %> $<%=gain%> | <% else %> $<%=gain%> | <% end %> |