I could see the newly added columns in the analytics table view. but values are not populated.
from the documentations and some previous discussion threads, I could read that the function is automatically mapped b/w the view definitions column name and value specification in the function definition.
can someone help me to get the values?
There are two likely reasons why there are no values being calculated for these columns:
The line added to ExampleFunctionConfigurationPopulator is not quite right. This defines the new functions against the name “EXAMPLE_FUNCTIONS” in the configuration database, but this entry is then replaced by a line further on in the file which defines “EXAMPLE_FUNCTIONS” as the union of “FINANCIAL_FUNCTIONS”, “STANDARD_FUNCTIONS”, and “CUBE_FUNCTIONS”. Modifying the code to https://gist.github.com/andrewgriffin/7929888 should address this. The new functions are written into a new configuration entry (called “custom”) and that is then merged into the overall “EXAMPLE_FUNCTIONS” set used by the engine.
The function is now in the repository, and is correctly defined, but only tells the system how to calculate DOUBLE_CLOSE at the SECURITY level. The grid of values displayed in the web interface shows values at the PORTFOLIO_NODE, POSITION, and TRADE level. One option is to add the following line to MyFunctions.java:
The function repository will now include rules to get from a value at the security level to values at the TRADE/POSITION level (by multiplying the security level value by the trade/position quantity) and to the PORTFOLIO_NODE level (by summing the position values). Depending on the meaning of the DOUBLE_CLOSE value, you might not want the value from the security level to be multiplied by the trade/position quantity. In which case, the AnalyticsFunctions.addUnitScalingAndSummingFunction may be more suitable. If producing a value at the aggregate level in this way makes no sense, or if a custom aggregation strategy is needed, then further alternatives are the addUnitScalingFunction and addScalingFunction methods from the same class.
I have been trying to get some values on the equity portfolio available with the example simulated and I would like to populate values from historical timeseries CLOSE which is also available with example simulated. I would like to see the market value (quantity * latest value of the CLOSE from the historical time series) of the equity portfolio(from the total portfolio level to the leaf trade level.)
I am sorry to change my requirement a bit. but it would be very useful if I could write some function near to a meaningful one.
Can I find an example similar to such a function in the example simulated?