Vision Application Classes: The Account Classes
Overview
The class Account is a super class of the classes Portfolio, AggAccount, IndexAccount, and CompositeAccount. A Portfolio is defined as an Account whose holdings are created via a feed from an internal accounting system. An AggAccount is defined as an Account whose holdings are created by combining the holdings for the list of Portfolios instances defined for the aggregate. An IndexAccount is defined as an account whose holdings are created starting with a list of Securities and a rule to derive a shares owned value. A CompositeAccount is defined as an Account whose holdings are created as a weighted combination of the holdings in a set of portfolio, aggregate, index and/or other composite accounts defined for the composite.
Messages that apply to all Account subclasses are defined at Account. Messages that address the unique requirements of Portfolio, AggAccount, IndexAccount and CompositeAccount instances are defined at the appropriate subclass. Your installation may define additional subclasses.
You do not directly create instances of the class Account. Instances are created for the different subclasses. In addition to the messages defined directly by the subclass, all instances respond to the messages defined for the class Account.
The following subset of the class hierarchy displays the classes directly related to Account:
Object | Entity | | | |-- Account | | | |-- AggAccount | | | |-- CompositeAccount | | | |-- IndexAccount | | | |-- Portfolio | LinkRecord | |-- CompositeAccount Component | |-- Holding
Basic Access
The naming dictionaries Named Portfolio, Named AggAccount, Named IndexAccount, and Named CompositeAccount, are used for naming individual instances of the Account subclasses. For example:
Named Portfolio XYZaccesses the Portfolio named XYZ and:
Named AggAccount Agg1accesses the AggAccount named Agg1.
An extra naming dictionary is defined at the Account class to allow interchangeable access among the classes. For example, the expression:
Named Account XYZalso returns portfolio XYZ. If the same id is used to identify a Portfolio and an instance of another Account subclass, the value in the Account naming dictionary will return the Portfolio instance. The property uniqueId is used to create a unique identifier for each instance. The expressions:
Named Account P_XYZ = Named Portfolio XYZ Named Account A_XYZ = Named AggAccount XYZ Named Account I_XYZ = Named IndexAccount XYZand
Named Account C_XYZ = Named CompositeAccount XYZall return the value TRUE.
The message locateId: has been redefined at the Account class to use the following search rule:
- Named Account
- Named Portfolio
- Named AggAccount
- Named IndexAccount
- Named CompositeAccount
For example, the expression:
Account locateId: "XYZ"returns Named Account XYZ if it is defined, otherwise it returns Named Portfolio XYZ, otherwise it returns Named AggAccount XYZ, otherwise it returns Named IndexAccount XYZ, otherwise it returns Named CompositeAccount XYZ, other it returns NA.
Account instances respond to all Entity and
Object messages such as code, name, and
baseCurrency.
The message profile has been redefined at Account
and some of the subclasses
to display account-related information. For example:
Named Portfolio XYZ displayInfo ;
displays a summary line of information about the portfolio XYZ and:
Named AggAccount AGG1 profile ;
displays key information about the aggregate AGG1.
The message masterList can be used to return the list of non-default instances for any of the Account subclasses. For example, to display the code and name for each Portfolio instance, use:
Portfolio masterList do: [ code print: 10 ; name printNL ; ] ;To display the number of AggAccount instances, use:
AggAccount masterList countIf you send the masterList message to the Account class, you will get the list of all non-default instances for all of the subclasses. For example:
Account masterList #-- get instances of all subclasses groupedBy: [ whatAmI ] . #-- group by subclass name do: [ printNL ; #-- print subclass name groupList #-- for each instance in class do: do: [ code print: 10 ; #-- print code name printNL ; #-- print name ] ; #-- end of instances in class ] ;
The Account Class
The class Account is used to unify the protocol that is common to all the subclasses.
The following messages return basic Account information:
Message | Return Class | Description |
---|---|---|
baseCurrency | Currency | default currency for storing and accessing monetary data for the account |
code | String | primary identifier |
creationDate | Date | date instance was created |
getHoldingIn: | Holding | returns holding in supplied security if held by recipient account |
hasHoldings | Boolean | does the recipient have holdings (as of ^date)? |
holdings | List | list of holdings in recipient (relative to ^date) |
holdingsDate | Date | effective date of holdings list (relative to ^date) |
holds: | Boolean | does the recipient hold supplied security? |
isMemberOf: | Boolean | is account in supplied universe or classification? |
name | String | account name |
_totalCost | Number | total cost of holdings (relative to ^date) |
totalCost | Number | currency adjusted total cost (relative to ^date) |
_totalMarketValue | Number | market value of holdings (relative to ^date) |
totalMarketValue | Number | currency adjusted market value (relative to ^date) |
_totalMarketValueCash | Number | total cash value of holdings (relative to ^date) |
totalMarketValueCash | Number | currency adjusted cash value (relative to ^date) |
_totalMarketValueEquity | Number | total equity value of holdings (relative to ^date) |
totalMarketValueEquity | Number | currency adjusted equity value (relative to ^date) |
_totalMarketValueFixed | Number | total fixed income value of holdings (relative to ^date) |
totalMarketValueFixed | Number | currency adjusted fixed income value (relative to ^date) |
uniqueId | String | code prefixed with subclass indicator |
universes | List | list of universes containing recipient |
The message getHoldingIn: returns an instance of the Holding class. The message holdings returns a List of instances of the Holding class. These and other related messages are described in the next section.
The total market value of an Account represents the market value of its holdings. This value is tracked over time and is normally recomputed each time holdings are updated. The time series property _totalMarketValue is used to track the total market value over time in the baseCurrency of the Account. The message totalMarketValue returns the market value in the account's base currency by default or a currency override, if defined. For example:
Named Portfolio XYZ do: [ baseCurrency code print: 5 ; #- default currency currency code print: 5 ; #- currency override _totalMarketValue printWithCommas: 18.0 ; #- latest raw value totalMarketValue printWithCommas: 18.0 ; #- currency adjusted ] ; ^today - 1 monthEnds evaluate: [ Named Portfolio XYZ do: [ baseCurrency code print: 5 ; #- default currency currency code print: 5 ; #- currency override _totalMarketValue printWithCommas: 18.0 ; #- eom raw value totalMarketValue printWithCommas: 18.0 ; #- currency adjusted ] ; ] ;displays the latest and prior month-end market value in the portfolio's base currency and the currency override. In this case the values are the same. The expressions:
"DEM" asCurrency evaluate: [ Named Portfolio XYZ do: [ baseCurrency code print: 5 ; #- default currency currency code print: 5 ; #- DEM _totalMarketValue printWithCommas: 18.0 ; #- latest raw value totalMarketValue printWithCommas: 18.0 ; #- value in DEM ] ; ] ; "DEM" asCurrency evaluate: [ ^today - 1 monthEnds evaluate: [ Named Portfolio XYZ do: [ baseCurrency code print: 5 ; #- default currency currency code print: 5 ; #- DEM _totalMarketValue printWithCommas: 18.0 ; #- eom raw value totalMarketValue printWithCommas: 18.0 ; #- value in DEM ] ; ] ; ] ;displays the latest and prior month-end market value in the portfolio's base currency and the currency override of DEM.
The messages totalMarketValueEquity, totalMarketValueCash, and totalMarketValueFixed return the total market values for the different asset categories. For example, to show the total market value and percent cash for each Portfolio use:
Portfolio masterList do: [ code print: 10 ; name print: 25 ; totalMarketValue printWithCommas: 15.0 ; totalMarketValueCash / totalMarketValue * 100 print: 10.2 ; newLine print ; ] ;
For general descriptions of all the Account messages, see the document Vision Application Messages: Account.
The Holding Class
The class Holding is used to represent a specific holding by an account in a security as of a specific point in time. Holdings are rarely (if ever) referenced directly. Instead they are accessed via a particular security or account. Holdings are normally created as part of a data upload process.
The following messages return basic Holding information:
Message | Return Class | Description |
---|---|---|
account | Account | account represented by holding |
_accountingPrice | Number | actual price used to compute market value, if available |
accountingPrice | Number | price used to compute market value, adjusted for splits and currency |
adjustmentFactor | Number | split adjustment factor |
baseCurrency | Currency | currency in which monetary values are stored (initialized to account's value) |
currencyFactor | Number | currency adjustment relative to date |
date | Date | Date of holding |
id | String | security/account indicator |
percentOfEquity | Number | percent of all equity holdings for account on date represented by this holding |
percentOfPort | Number | percent of total market value for account on date represented by this holding |
security | Security | security represented by holding |
_shares | Number | actual shares held by account in security on date |
shares | Number | shares adjusted for splits since date |
_totalCost | Number | actual cost of shares held by account in security on date |
totalCost | Number | cost adjusted for currency |
_totalMarketValue | Number | actual market value of shares hold by account in security on date |
totalMarketValue | Number | market value adjusted for currency |
For general descriptions of all the Holding messages, see the document Vision Application Messages: Holding.
Holdings Access
Each Holding responds to the messages security and account by returning an instance of those classes; therefore, any messages defined at Security or Account can be referenced via a specific Holding. The message id has been defined at Holding to return a string in the form securityCode---accountCode. For example, the expression:
Named Portfolio XYZ getHoldingIn: Named Security GM . iddisplays the string 37044210---XYZ.
The message holdings is defined for the Account and Security classes to return the list of Holding instances associated with the security or account as of the current evaluation date. Since the message holdings returns a List, any message defined for the List class can be sent to it (e.g., do:, select: , groupedBy:, sortUp: , etc.). For example:
Named Portfolio XYZ holdings #-- returns List of Holdings do: [ security name print: 30 ; #-- security level security price print: 10 ; #-- security level totalMarketValue printNL: 15 ; #-- holding level ] ; Named Portfolio XYZ holdings groupedBy: [ security company country ] . do: [ code print: 10 ; name printNL ; #-- country level groupList sortDown: [ percentOfPort ] . do: [ security name print: 30 ; #-- security level security price print: 10 ; #-- security level totalMarketValue print: 15 ; #-- holding level percentOfPort printNL ; #-- holding level ] ; newLine print ; ] ;The message getHoldingIn: is used to get an account's Holding in a specific security if it exists. A default Holding is returned otherwise. For example:
Named Portfolio XYZ getHoldingIn: Named Security GM . percentOfPortreturns the percentage of Portfolio XYZ represented by the holding in GM. The message holds: is used to indicate whether or not an account holds a specific security. It returns a Boolean value. For example:
Portfolio masterList select: [ ^self holds: ^global Named Security GM ] . do: [ code print: 10 ; name printNL ] ;displays the code and name of every Portfolio that currently holds GM.
Since holdings are stored over time, you can access a Portfolio's holdings as of a different date using:
9612 evaluate: [ Named Portfolio XYZ holdings do: [ security name print: 30 ; security price print: 10 ; totalMarketValue printNL: 15 ; ] ; ]This displays the holdings information as of Dec 31, 1996. The message holdingsDate can be used to display the effective date of the holdings list being accessed. For example:
9612 evaluate: [ Named Portfolio XYZ do: [ "Holdings As Of: " print; holdingsDate printNL ; holdings do: [ security name print: 30 ; security price print: 10 ; totalMarketValue printNL: 15 ; ] ; ] ] ;The message hasHoldings is defined for the Account class to indicate whether the account has holdings as of the current evaluation date. For example, the expression:
Portfolio masterList select: [ hasHoldings ] . do: [ displayInfo ] ;displays the list of portfolios that have current holdings and the expression:
9612 evaluate: [ Portfolio masterList select: [ hasHoldings ] . do: [ displayInfo ] ; ] ;displays the list of portfolios that had holdings as of Dec 31, 1996.
The message holdings can be used to access the List of Holdings associated with a Security as well. For example:
Named Security GM holdings #-- returns List of Holdings do: [ account code print: 5 ; #-- account level account name print: 20 ; #-- account level security price print: 10 ; #-- security level totalMarketValue printNL: 15 ; #-- holding level ] ;
Holdings access by Security is described in more detail later in this document.
The Holding class structure is illustrated below:
_____________ | Holding |--| |___________| | ______________ |---- security ---> | Security | | |____________| ___________ | | | ... | | |---- holdings ---> | Holding | | | | Holding | | | | ... | | | |_________| | | | |---- code | |---- name | |---- price | |---- company ---> | __________________ |---- account ---> | Account | | |________________| ___________ | | | ... | | |---- holdings ---> | Holding | | | | Holding | | | | ... | | | |_________| |---- date |--- code |---- baseCurrency |--- name |---- percentOfPort |---- baseCurrency |---- shares |---- totalMarketValue |---- totalCost |---- totalMarketValueEquity |---- totalMarketValue |--- totalMarketValueCash | |
Holdings Creation
A Holding in a Portfolio represents the actual number of shares held by the Portfolio in a Security on a specific date. The Holdings for an AggAccount are created by collecting the holdings associated with each of its member Portfolios and creating a single Holding for each distinct Security represented. The Holdings for an IndexAccount are created starting with a list of securities and a rule to derive shares owned values. The Holdings for a CompositeAccount are created as a weighted combination of the holdings in a set of portfolio, aggregate, index and/or other composite accounts defined for the composite.
Holdings are created using the createHoldingsFrom: message defined for Account. The parameter is a list of securities extended by the messages security, totalMarketValue, shares, totalCost, and optionally, accountingPrice. When executed, this message performs the following steps:
- Initializes time series properties on current evaluation date (^date).
- Creates a new Holding instance for each non-cash security in the
supplied list.
- Updates the _shares, _totalMarketValue, and
_totalCost properties for each new holding.
- Updates the _accountingPrice property, if supplied.
- Creates a single holding in security CashUS representing cash
for the account.
- Updates the holdingsSeries time series for the Account with the
new list of holdings. Note that the message holdings accesses
this time series.
- Executes the computeAccountTotals message which updates the Account properties _totalMarketValue, _totalMarketValueCash, _totalMarketValueEquity, _totalMarketValueFixed, and _totalCost, and updates the Holding properties percentOfPort and percentOfEquity.
This method is normally not run directly; several DataFeed subclasses have been defined for creating holding data.
The Portfolio Class
The class Portfolio is used to define the messages that are specific to portfolios. In addition to the messages defined for the Account class, Portfolio instances respond to the following messages:
Message | Return Class | Description |
---|---|---|
aggregateList | List | list of AggAccounts that include recipient Portfolio |
A Portfolio can be a member of any number of AggAccount instances. Portfolios can be added to and deleted from aggregates over time. The aggregateList message returns the list of AggAccount instances that include the Portfolio as of the evaluation date. For example:
Named Portfolio XYZ aggregateList #- current agg list do: [ displayInfo ] ;displays the list of current AggAccount instances that include Portfolio XYZ and:
9612 evaluate: [ Named Portfolio XYZ aggregateList #- 12/96 agg list do: [ displayInfo ] ; ] ;displays the list of AggAccount instances as of Dec 31, 1996 that include Portfolio XYZ.
The AggAccount class is discussed in the next section. For general descriptions of all the Portfolio messages, see the document Vision Application Messages: Account.
Updating Portfolio Data
The PortfolioMaster data feed can be used to create and refresh Portfolio instances:
Interface ExternalFeedManager upload: "PortfolioMaster" using: #-- make sure this is tab-delimited "EntityId Name ShortName PORT1 EQUITY INCOME FUND EI FUND PORT2 GROWTH FUND GR FUND " ;
The HoldingsFeed data feed can be used to create holdings over time for one or more Portfolios. The following tab-delimited feed could be used to create Portfolio holdings for several portfolios on a single date. Market values will be derived for each holding:
Interface ExternalFeedManager upload: "HoldingsFeed" using: #-- make sure this is tab-delimited "date acctId secId shares 9712 PORT1 GM 1000 9712 PORT1 F 2000 9712 PORT1 CASH 20000 9712 PORT2 IBM 10000 9712 PORT2 DELL 15000 9712 PORT2 CASH 20000 " ;The following tab-delimited feed could be used to create Portfolio holdings for several portfolios on several dates. Market values are assigned directly from this feed:
Interface ExternalFeedManager upload: "HoldingsFeed" using: #-- make sure this is tab-delimited "date acctId secId mval 9712 PORT1 GM 1234.56 9712 PORT1 F 2345.67 9712 PORT1 CASH 20000.00 9712 PORT2 IBM 9876.54 9712 PORT2 DELL 8765.43 9712 PORT2 CASH 10000.00 9711 PORT1 GM 1233.21 9711 PORT1 F 2344.32 9711 PORT1 CASH 20000.00 " ;
After running this upload, you can access the holdings using:
Named Portfolio PORT1 holdings #-- returns List of Holdings do: [ security name print: 30 ; #-- security level totalMarketValue print: 15 ; #-- holding level percentOfPort printNL ; #-- holding level ] ;
The AggAccount Class
The class AggAccount is used to define the messages that are specific to aggregate accounts. In addition to the messages defined for the Account class, AggAccount instances respond to the following messages:
Message | Return Class | Description |
---|---|---|
memberList | IndexedList | list of member Portfolios |
An AggAccount can be composed of any number of Portfolio instances. Portfolios can be added to and deleted from aggregates over time. The memberList message returns the list of Portfolio instances in the aggregate as of the evaluation date. For example:
Named AggAccount AGG1 memberList #-- current memberList do: [ displayInfo ] ;displays the list of current Portfolio instances in AggAccount AGG1 and:
9612 evaluate: [ Named AggAccount AGG1 memberList #-- members as of 12/31/96 do: [ displayInfo ] ; ] ;displays the list of Portfolio instances as of Dec 31, 1996 included in AggAccount AGG1.
For general descriptions of all the AggAccount messages, see the document Vision Application Messages: Account.
The Holdings for an AggAccount are created by collecting the holdings associated with each of its member Portfolios and creating a single Holding for each distinct Security represented. AggAccount holdings are normally updated whenever the holdings for any of its member Portfolios are updated and whenever the membership of the AggAccount is changed.
Updating AggAccount Data
The AggAccountMaster data feed can be used to create and refresh AggAccount instances:
Interface ExternalFeedManager upload: "AggAccountMaster" using: #-- make sure this is tab-delimited "EntityId Name ShortName AGG1 Aggregate Account 1 Agg Acct 1 AGG2 Aggregate Account 2 Agg Acct 2 " ;
The PortfolioAggregates data feed can be used to define memberships over time:
Interface ExternalFeedManager upload: "PortfolioAggregates" using: #-- make sure this is tab-delimited "groupId memberId date #- define AGG1 to have 3 members since earliest possible date AGG1 PORT1 Default AGG1 PORT2 Default AGG1 PORT3 Default #- define AGG2 to have 2 members in 95 and a third added in 96 AGG2 PORT2 1/1/95 AGG2 PORT7 1/1/95 AGG2 PORT2 1/1/96 AGG2 PORT7 1/1/96 AGG2 PORT4 1/1/96 " ;
After running an upload, you can access an AggAccount's holdings just like any other Account. For example:
Named AggAccount AGG2 holdings #-- returns List of Holdings do: [ security name print: 30 ; #-- security level totalMarketValue print: 15 ; #-- holding level percentOfPort printNL ; #-- holding level ] ;
The IndexAccount Class
The class IndexAccount is used to define the messages that are specific to index accounts. In addition to the messages defined for the Account class, IndexAccount instances respond to the following messages:
Message | Return Class | Description |
---|---|---|
getMemberWeightsUsingAccount: | List | list of member securities extended by various weighting statistics |
memberList | IndexedList | list of member Securities |
style | String | EvenDollar or MCapWeighted indicator |
universe | Universe | universe from which memberList was derived. |
An IndexAccount is defined based on a list of Security members. This list is stored in the property memberList and can vary over time. For example:
Named IndexAccount INDEX1 memberList #-- current memberList do: [ displayInfo ] ;displays the list of current Security instances in IndexAccount INDEX1 and:
9612 evaluate: [ Named IndexAccount INDEX1 memberList #-- members as of 12/31/96 do: [ displayInfo ] ; ] ;displays the list of Security instances as of Dec 31, 1996 included in IndexAccount INDEX1.
Although this list can be manually set using the setSecuritiesTo:asOf: message, it is normally updated using one of the data feeds defined for IndexAccounts.
The message getMemberWeightsUsingAccount: is used to extend the current list of member securities by their market value and weights based on various weighting schemes. The message returns the member security list extended by the messages: pctEvenDollar, mvalEvenDollar, pctMCapWeighted, mvalMCapWeighted, pctMValWeighted, and mvalMValWeighted.
The MVal-weighted values are computed using the corresponding holding in the supplied Account. This value can be supplied as NA. The even dollar technique assumes that $1,000 is invested in each security in the index. The market cap weighted technique assumes you own all the outstanding shares in the security, valued at the current evaluation date's price. If an Account or valid account id is supplied as a parameter to this message, the market value weighted technique assumes that you own the same number of shares in the security that you own in the supplied account, valued at the current evaluation date's price.
For example, the expression:
Named IndexAccount INDEX1 getMemberWeightsUsingAccount: NA . do: [ ticker print: 10 ; #- security ticker name print: 30 ; #- security name pctEvenDollar print ; #- %held if even dollar weighted pctMCapWeighted print ; #- %held if mkt cap weighted newLine print ; ] ;generates a report that shows the even dollar and market cap weighted percentages held for each security in the the IndexAccount.
For general descriptions of all the IndexAccount messages, see the document Vision Application Messages: Account.
Updating IndexAccount Data
The IndexAccountMaster data feed can be used to create and refresh IndexAccount instances:
Interface ExternalFeedManager upload: "IndexAccountMaster" using: #-- make sure this is tab-delimited "EntityId Name ShortName INDEX1 Index Account 1 Index Acct 1 INDEX2 Index Account 2 Index Acct 2 " ;
Several techniques are available for generating holdings for an
IndexAccount using the
HoldingsFeed data feed.
You can supply explicit shares and/or mval values
to derive the holdings. For example,
the following tab-delimited feed could be used to create IndexAccount
holdings for several accounts on a single date. Market values will be
derived for each holding using the security's price:
Interface ExternalFeedManager upload: "HoldingsFeed" using:
"date acctId secId shares
9712 INDEX1 GM 1000
9712 INDEX1 F 2000
9712 INDEX2 IBM 10000
9712 INDEX2 DELL 15000
" ;
The following tab-delimited feed could be used to create even dollar holdings for several IndexAccounts:
Interface ExternalFeedManager upload: "HoldingsFeed" using: #-- make sure this is tab-delimited "date acctId secId mval 9712 INDEX1 GM 100 9712 INDEX1 F 100 9712 INDEX1 C 100 9712 INDEX2 IBM 100 9712 INDEX2 DELL 100 9712 INDEX2 HWP 100 9711 INDEX1 GM 100 9711 INDEX1 F 100 9711 INDEX1 C 100 " ;
The following tab-delimited feed could be used to create market-cap-weighted holdings for several IndexAccounts:
Interface ExternalFeedManager upload: "HoldingsFeed" using: #-- make sure this is tab-delimited "date acctId secId mval 9712 INDEX1 GM 12345.67 9712 INDEX1 F 9876.54 9711 INDEX1 GM 12345.00 9711 INDEX1 F 9876.00 9712 INDEX2 IBM 23456.78 9712 INDEX2 DELL 8765.43 9712 INDEX2 HWP 9876.54 " ;You can exclude the mval column if the marketCap message has been defined for Security.
The IndexAccountBuilder data feed is used to define a universe and weighting rule from which to derive the securities and shares. The records supplied by this feed are used to update the IndexAccount time series properties universe and style. Whenever a membership is updated, the holdings for the IndexAccount are recreated for that date.
The following tab-delimited feed could be used to derive IndexAccount holdings from existing Universe memberships:
Interface ExternalFeedManager upload: "IndexAccountBuilder" using: #-- make sure this is tab-delimited "entityId date universeId style INDEX1 96 SP500 EVEN INDEX1 97 SP500 MCAP " ;This upload uses the securities in the SP500 Universe as of year-end 1996 to create even-dollar holdings (i.e., each holding will have the same totalMarketValue and the same percentOfPort values) as of 12/31/96. This upload uses the securities in the SP500 Universe as of year-end 1997 to create market-cap-weighted holdings as of 12/31/97. This style assumes that the message marketCap has been defined for Security to return the market capitalization as of the evaluation date.
After running any of these uploads, you can access an IndexAccount's holdings just like any other Account. For example:
Named IndexAccount INDEX1 holdings #-- returns List of Holdings do: [ security name print: 30 ; #-- security level totalMarketValue print: 15 ; #-- holding level percentOfPort printNL ; #-- holding level ] ;
The CompositeAccount Class
The class CompositeAccount is used to define the messages that are specific to composite accounts. A CompositeAccount is defined as an Account whose holdings are created as a weighted combination of the holdings in a set of portfolio, aggregate, index and/or other composite accounts defined for the composite.
In addition to the messages defined for the Account class, CompositeAccount instances respond to the following messages:
Message | Return Class | Description |
---|---|---|
componentList | IndexedList | list of CompositeAccount Component instances |
CompositeAccount Component instances are use to define a component account for a CompositeAccount on a specific date. These instances respond to the following messages:
Message | Return Class | Description |
---|---|---|
account | Account | account included in composite |
compositeAccount | CompositeAccount | composite that includes component |
date | Date | date in componentList that includes component |
weight | Number | weight of account in composite on date |
A CompositeAccount can be composed of any number of Account instances. Accounts can be added to and deleted from composites over time. The comonentList message returns the list of CompositeAccount Component instances in the composite as of the evaluation date. For example:
Named CompositeAccount COMP1 componentList #-- current components do: [ account code print: 10 ; #-- account code account name print: 25 ; #-- account name weight printNL ; #-- weight ] ;displays the current list of accounts and weights in CompositeAccount COMP1 and:
9612 evaluate: [ Named CompositeAccount COMP1 componentList #-- 12/31/96 components do: [ account code print: 10 ; #-- account code account name print: 25 ; #-- account name weight printNL ; #-- weight ] ; ] ;displays the list of accounts and weights in CompositeAccount COMP1 as of Dec 31, 1996.
For general descriptions of all the CompositeAccount messages, see the document Vision Application Messages: Account.
The Holdings for a CompositeAccount are created by collecting the holdings associated with each of its component Accounts, deriving shares and market value using the component's weight, and creating a single Holding for each distinct Security represented. CompositeAccount holdings are normally updated whenever the membership of the CompositeAccount is changed.
Holdings are normally created for CompositeAccounts using the CompositeAccountMembers data feed described in the next section.
Updating CompositeAccount Data
The CompositeAccountMaster data feed can be used to create and refresh CompositeAccount instances:
Interface ExternalFeedManager upload: "CompositeAccountMaster" using: #-- make sure this is tab-delimited "EntityId Name ShortName COMP1 Composite Account 1 Comp Acct 1 COMP2 Composite Account 2 Comp Acct 2 " ;
The CompositeAccountMembers data feed is used to define the weighted combinations of Portfolio, AggAccount, IndexAccount, and/or other CompositeAccount instances that make up a composite over time. The records supplied by this feed are used to update the CompositeAccount time series property componentList. Whenever a membership is updated with this feed, the holdings for the CompositeAccount are recreated for that date.
For example, this tab-delimited string can be used to define memberships over time:
Interface ExternalFeedManager upload: "CompositeAccountMembers" using: #-- make sure this is tab-delimited "date groupId memberId weight #- create a composite representing 50% of PORT1's holdings 97 COMP1 PORT1 50 #- create a composite representing equal amounts of 4 accounts #- in 95, unequal amounts in 96 95 COMP2 PORT7 25 95 COMP2 AGG1 25 95 COMP2 INDEX7 25 95 COMP2 COMP1 25 96 COMP2 PORT7 33 96 COMP2 AGG1 33 96 COMP2 INDEX7 33 96 COMP2 COMP1 1 " ;
After running this upload, you can access CompositeAccount Comp2's holdings just like any other Account. For example:
Named Account COMP2 holdings #-- returns List of Holdings do: [ security name print: 30 ; #-- security level totalMarketValue print: 15 ; #-- holding level percentOfPort printNL ; #-- holding level ] ;
Updating Account and Holding Data - Summary
The Interface class ExternalFeedManager has been created to provide a uniform way to create and update any entity-related information. DataFeed subclasses are defined to translate one or more rows of information into the appropriate structures in your Vision database. Data can be supplied from a file, a spreadsheet, a relational database, or any other table-based source. You can also supply data directly as a string, using the tab character to delimit columns and the carriage return to delimit rows.
Several DataFeed classes have been defined to create and update instances of the Account subclasses and to load holdings for these instances over time:
DataFeed | Description |
---|---|
PortfolioMaster | creates Portfolio instances and refreshes basic properties |
AggAccountMaster | creates AggAccount instances and refreshes basic properties |
IndexAccountMaster | creates IndexAccount instances and refreshes basic properties |
CompositeAccountMaster | creates CompositeAccount instances and refreshes basic properties |
HoldingsFeed | loads holding records for one or more Portfolio or IndexAccount instances for one or more time periods |
PortfolioAggregates | defines Portfolio memberships in AggAccounts over time and creates holdings for each period |
IndexAccountBuilder | creates holdings for one or more IndexAccount instances over time using securities from an existing Universe and a weighting rule |
CompositeAccountMembers | defines weighted combinations of Portfolio, AggAccount, IndexAccount, and/or other CompositeAccount instances that make up a composite over time |
Account and Holding Access By Security
A number of messages are defined at Security to return related Account and Holding information:
Message | Return Class | Description |
---|---|---|
getAggAccounts | List | list of aggregates that hold security (relative to ^date) |
getHoldingIn: | Holding | returns holding in supplied portfolio (relative to ^date) |
getIndexAccounts | List | list of index accounts that include security as a member (relative to ^date) |
heldIn: | Boolean | is security held in supplied portfolio? |
holdings | List | list of holdings in recipient (relative to ^date) |
holdingsDate | Date | effective date of holdings list (relative to ^date) |
The message holdings can be used to access the List of Holdings associated with a Security. For example:
Named Security GM holdings #-- returns List of Holdings do: [ account code print: 5 ; #-- account level account name print: 20 ; #-- account level security price print: 10 ; #-- security level totalMarketValue printNL: 15 ; #-- holding level ] ;
Note that this List of Holding instances only includes Portfolios holdings.
Since holdings are stored over time, you can access the holdings in a Security as of a different date using:
9612 evaluate: [ Named Security GM holdings #-- returns List of Holdings do: [ account code print: 5 ; #-- account level account name print: 20 ; #-- account level security price print: 10 ; #-- security level totalMarketValue printNL: 15 ; #-- holding level ] ; ] ;