Can i run hostrical portfolio on historical time series


Hi ,

Say i have a portfolio which i update daily. I need to see how it performed over the time.
Like i want to see the total market value of the portfolio over a period of time , is it possible with the current view processor engine.
AFAIK , i can only run a version of portfolio over a historical time series.
Can i run a portfolio of a particular date on that particular date of timeseries over a range of dates ?



There’s a field in the ViewExecutionOptions, the versionCorrection, which allows you to select a particular portfolio version to match the time series.

There’s also the a per cycle option (in a sequence of ViewCycleExecutionOptions) MarketDataSpecification, which allows you to specify the time used for the historical time series data, and then there’s the valuation time, which allows you to specify the time used by the analytic library as ‘now’. Typically you’d want all three the same.

What you can’t currently do is have a sequence, with each cycle having a different portfolio version correction as it’s in ViewExecutionOptions rather than ViewCycleExecutionOptions. That’s probably just the way the API developed and I’ll see in the longer term about moving the portfolio version/correction into the ViewCycleExecutionOptions, but for now, you’ll likely have to kick off a separate View Process for each scenario.


Hello @jim ,

Running a separate view execution for each version would prove quite costly if the portfolio is updated on a daily fashion or a more frequent manner. As we would be dealing with such situation , am thinking of writing a small engine for running what i need. Also we wont be using a nested portfolio , hence there would be only positions in the root node. So it should not be a big task to write one for myself. What i have in mind is when a view definition is given , it will execute a timeseries against the right instant of the version of portfolio.

If you have some advice or suggestion , you are mostly welcome.



I think it depends on your time scales. We will definitely be addressing this issue in the next few months, so it depends if you are okay with a slightly slower implementation until we do the necessary work, or if you need something quick and dirty now. I assume by ‘engine’ you mean something special purpose for your particular requirement. That might work better for you in the short term if your need is urgent.

The reason your particular request is not a simple change is that by changing the portfolio version, we’re invalidating the dependency graph. That means we’d need to rebuild it for each portfolio version. To get around this we need to implement incremental dependency graph compilation, which will only make the necessary changes rather than do a whole-graph rebuild.

We’re just finishing a bunch of the ground work necessary for this - in particular we’re removing the link that positions have to their parent portfolio node, which means they can live in multiple portfolio nodes. This means that position and portfolio version changes can be acted upon by the engine because we have the real position ids rather than the weird combined ids that the PositionSource currently returns.

I’ll make the decision shortly whether to focus our next efforts on incremental compilation or on intra-view sub-view processing (having a view that’s able to spawn child processes that each run a scenario). I suspect I’ll chose the former, but I need to discuss with the senior engineer on the project first.


Hello @jim ,

Thank you for your considering our feature interests.
We see a portfolio not as a set of different positions over time but a logic based on which we decide on a set of position. The position list will change over time but then logic would be the same or refined.
Speaking from this perspective , I feel the ability to see how well/bad a portfolio (or rather the logic which the portfolio is based on ) performed over the time is one of the basic portfolio operation we would love to see.
I will go ahead and make a small engine for our purpose and we will wait for this feature and once with this feature we will move to OG’s way.



Thanks @Vineeth and @Jim for bringing up this important topic and sharing the ideas and development plans.

On topic of portfolio rolling with the timeseries, I think it is important to have both the options. First option being the portfolio “roll” with the time series and second being take a portfolio and run it across different time samples.

Applications I can think of, for first case, it will then be possible to calculate cumulative performance P&L of an actual portfolio, trade performance attribution, turnover statistics etc

In the second case, we can compare riskmetrics of portfolios on different time samples. Like stress testing, drawdown etc.

Hoping to see these features soon. Thanks again for sharing ideas and commitment to the open source world.


An engineer is now working on the incremental dependency graph compilation.


That is wonderful. Thank you @Jim


Hello @jim ,

Can i please know if there is any update on this feature.



It’s been done and is working in a private branch, but is awaiting full merge and extensive testing with the develop branch. We’re not going to merge it prior to 1.2 because it’s quite a big change, but we should be able to merge it in to develop within a week or two. We’re also working on being able to spawn sub-view processes from an engine function, which will allow full PnL, live full reval VaR, etc, but that isn’t quite finished yet. We may end up merging both features together.


Please can you confirm if this is now in 2.*? Thanks


It is.