Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Finance Smart Blocks for Developing Scenarios | CMF legacy finance support smart blocks | P&L Calculator v4.0
 
P&L Calculator v4.0
This block calculates the Profit and Loss value, which is the difference between the cash spent and the product of the most recent market value for the number of shares held. A positive value indicates a profit, and a negative value indicates a loss. The block subscribes to market data; see the Market Depth block for information about how this works and the meaning of the service ids parameter.
Description
To make this block available to your scenario, you must add the Legacy Finance Support bundle to your project.
The block has one input feed, which would be typically wired as follows:
From Order Manager output feed: status order
To P&L Calculator input feed: trades
last price executed
price
last quantity executed
volume
side
side
Parameters
Parameter
Description
service identifier
An identifier for the system from which to get the market data.
market identifier
An identifier for the market from which to get data. Some service providers ignore this setting.
extra parameters
A payload-format string containing any other parameters for the market. Some service providers ignore this parameter.
Operations
Operation
Description
start
Starts the calculation of P&L. Must be called before the calculator will generate any statistics.
stop
Stops the calculation of further P&L. Any subsequent input feeds are ignored.
clear
Clears the current data set.
Input feeds
The position feed represents the stream of position data per instrument. This feed would be typically wired to the position output feed of the Position Calculator block.
Feed
Fields
Description
position
symbol
The symbol of the incoming trade data.
money balance
The net currency made on this instrument; increases when we sell, decreases when we buy.
position
The position in this currency. Positive if we are long.
Output feeds
Feed
Fields
Description
P&L
total money balance
The net currency made across all instruments; increases when we sell, decreases when we buy. This is the realized profit.
total market value
The market value of the position across all instruments. This is the unrealized profit.
profit
The sum of the realized and unrealized profit (net profit = total money balance + total market value).
waiting for prices
Set if the total market value and thus profit are inaccurate because we are waiting for pricing data.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.