Automating Portfolio Analysis with Historic End-of-Day Prices
If you have ever rebuilt the same correlation matrix by hand three quarters in a row, you already know where this article is going. The routine is always the same: export a fresh price history from a broker or a data vendor, paste it into a spreadsheet, compute returns, build a correlation table, stare at it, pick weights that feel defensible, write the trades, then repeat everything next quarter with a slightly different date range. It works — until it doesn’t scale.
The failure mode isn’t that the math is wrong. It’s that the process is unrepeatable. Every run introduces small variations: a different start date, a forgotten split adjustment, a ticker that silently dropped out of the export. By the time you compare two allocations, you can’t tell whether the difference comes from the market or from your own pipeline.
This is exactly the kind of task worth automating: automate portfolio rebalancing with historical end-of-day prices, then run the same pipeline on a schedule with the same parameters. The good news is that for long-term allocation decisions, daily closing prices are enough. You are not trying to trade the open; you are estimating long-run covariance between assets. Intraday ticks add noise, cost, and infrastructure — not signal, at least not for a quarterly rebalancing decision.
RSJ Portfolio is a Windows desktop application that does precisely this: it builds a statistically optimized stock portfolio from historic end-of-day prices, analyses return correlation between stocks, and allocates capital to candidates that correlate weakly — or whose downside correlates weakly — which reduces the volatility of the resulting portfolio. Allocation uses modern portfolio theory, and the objective, risk estimator, and weight constraints are all selectable.
If you’d rather understand the manual process first — what “low correlation” actually means and how to assemble such a portfolio by hand — read How to Build a Low Correlation Stock Portfolio, Step by Step. This article is about the automation layer on top of it.
One-Time Setup: Configuration for Repeatable Runs
The point of a one-time setup is that everything after it becomes a single action. In a hand-rolled pipeline, “setup” is usually a config file you keep rewriting; in RSJ Portfolio it’s a set of configuration choices that persist across runs.
Requirements and installation. RSJ Portfolio is a Windows desktop application. You install it with the Windows installer published on the downloads page; the installer filename is versioned and its SHA-512 checksum is published on the same page. Verify the hash before running it — this is a two-second habit that protects you from a corrupted or tampered download:
# Windows PowerShell
Get-FileHash .\RSJ-Portfolio-Setup.exe -Algorithm SHA512
Compare the output with the checksum listed on the downloads page. Both the English and German user guides are also available there as HTML.
Configuration worth setting before the first run. The Configuration chapter of the user guide covers the settings you’ll touch once and then forget:
- Data provider — where historic end-of-day prices come from.
- Local cache — prices are cached locally, so repeated runs don’t re-fetch the same history.
- Local currency — your reporting currency, used by the conversion path for portfolios quoted in several currencies.
- Date range — the lookback window used for correlation and optimization.
- Price cleaning settings — the rules applied to raw prices before they enter the analysis.
Because these persist, two runs a month apart are genuinely comparable. That’s the whole game.
Build a candidate list. The Selection step is where you search symbols and assemble the candidate list that the optimizer will allocate across. Treat this list as a first-class artifact, not a scratch buffer: it’s the single biggest driver of what the optimizer can possibly return. Keep it stable between runs unless you have a deliberate reason to change it — a point we come back to in the best practices section.
Pick sane starting parameters. The Getting Started guide lists requirements, the configuration worth setting before the first run, and the recommended starting parameters, plus how to read the results. Start there rather than guessing at the optimizer’s knobs on day one.
The Automated Pipeline: From Prices to Allocation
Once configured, a run is a sequence of five stages. Understanding them matters because when a result looks odd, the stage where it went wrong is usually obvious in hindsight.
Step 1: Data ingestion
RSJ Portfolio fetches historic end-of-day prices from the configured provider and caches them locally. The cache is what makes repeated runs cheap and stable: the same history is reused rather than re-downloaded, so a re-run minutes later doesn’t silently pick up a slightly different dataset.
The Data and Currencies page documents the supported providers, the cache behaviour, and the multi-currency conversion path.
Step 2: Price cleaning
Raw vendor data is never quite clean. The pipeline applies cleaning rules to handle splits, dividends, and missing data. Cleaning settings are part of your configuration, so the same rules apply on every run — which is the difference between a pipeline and a spreadsheet.
In practice, this is the stage most likely to produce a warning worth reading. A cleaning warning about a specific symbol usually means the price history for that instrument had a gap, a corporate action, or a suspicious jump. Don’t ignore it; the optimizer will happily build weights on a broken series.
Step 3: Correlation analysis
Here is where the portfolio’s risk profile is actually decided. The tool computes return correlations across your candidate list and identifies candidates that correlate weakly — or whose downside correlates weakly. The second part matters: two assets can look uncorrelated across all days and still fall together on the bad ones.
If you want the conceptual background on why this reduces portfolio volatility, see Correlation and Volatility: A Long-Term Investor’s Guide. The short version: combining weakly correlated return streams cancels out idiosyncratic swings, so the aggregated portfolio moves less than its parts.
Step 4: Optimization
Now you select the parameters that define “best” for your situation. The Methods and features page enumerates the options:
- Objectives — minimum volatility, maximum Sharpe ratio, minimum semi variance, hierarchical risk parity, and conditional value at risk.
- Risk models — eight risk estimators to choose from, along with return models.
- Weight constraints — bounds that keep the optimizer inside positions you can actually hold.
Hierarchical risk parity, for example, doesn’t rely on inverting a covariance matrix, which makes it a different kind of answer rather than just a different number. For a plain-language walkthrough of that method, see What Is Hierarchical Risk Parity? A Plain-Language Explanation.
Step 5: Output
The optimizer produces an allocation presented as a recommendation, ready to be applied to your portfolio. That recommendation is the artifact you compare across runs.
The hard way, for contrast
Doing this yourself means scripting provider downloads, stitching price series, computing a correlation matrix, and wiring up an optimizer — plus writing the tests that tell you whether the numbers are right. It’s a fine weekend project and a poor quarterly habit. RSJ Portfolio replaces that with a managed, one-step workflow: configure once, run the pipeline, read the recommendation. If you want a sense of what the optimizer is doing under the hood, the Concept chapter covers the statistical background.
Monitoring and Failure Handling
Automation without monitoring is just deferred debugging. A short checklist after each run catches almost everything.
Check data freshness. Confirm the cached price history actually extends to the date you expect. If the local currency or the date range changed, the effective window may not be what you think it is.
Read the cleaning warnings. Warnings are the pipeline telling you it had to make a judgement call about a symbol. Investigate anything new since the last run.
Sanity-check the optimization result. Look at the weight distribution before you look at the expected return. Wildly concentrated weights, or weights that swing massively from the previous run, usually indicate a problem upstream — a short or stale history, a bad series, or constraints set too loosely.
Handle missing or stale prices. The local cache and cleaning settings absorb a lot of this, but if a symbol has genuinely stopped updating, verify your date range and check the Data and Currencies page for how the provider is being queried.
Decide when to re-run. RSJ Portfolio doesn’t impose a schedule; you run the optimizer whenever you update your data. Most people automate on a fixed cadence — monthly or quarterly — and treat off-cycle runs as exceptions rather than habits. Running more often mostly increases turnover and transaction costs.
Export results for record-keeping. Exports are part of the feature set (see Methods and features), and they’re what let you compare allocations across runs rather than trusting memory.
Validate before you trust. A portfolio that looked great in backtest can be a portfolio that fit noise. Work through Is Your Optimized Allocation Overfit? A Practical Checklist before you scale up a new configuration.
A minimal run log — you can keep this next to your exported results — makes the pattern visible:
# run-log.yaml — one entry per optimization run
run: 2026-10-01
config:
data_provider: configured-provider
local_currency: EUR
date_range: 2016-10-01/2026-09-30
cleaning: default
candidate_list_version: 7
objective: minimum_volatility
risk_model: semi_variance
constraints:
max_weight_per_asset: 0.10
checks:
data_fresh_through: 2026-09-30
cleaning_warnings: 1 # investigate: symbol XYZ
max_weight_actual: 0.094
export: exports/2026-10-01-allocation.csv
Best Practices for Automated Rebalancing
Match the objective to your risk tolerance. Minimum volatility for conservative mandates; maximum Sharpe ratio when you’re return-focused and can tolerate more path variation. The trade-offs are covered in depth in Minimum Volatility vs Maximum Sharpe Ratio: Which to Choose?. Pick one deliberately and stick with it — switching objectives between runs makes comparisons meaningless.
Use a risk estimator consistent with your objective. Semi variance pairs naturally with downside protection; conditional value at risk addresses tail risk. RSJ Portfolio offers eight risk models plus multiple return models, so you’re not forced into a single convention.
Set weight constraints you can live with. Constraints do two jobs: they prevent over-concentration in a single name, and they improve the robustness of the result. A tighter per-asset cap usually costs you a little theoretical return and buys you a lot of sleep.
Keep the candidate list stable. Every symbol you add or remove rewrites the optimization problem and generates trades. Change the list on purpose, with a reason, not incidentally between runs.
Document configuration and cadence. If you can’t reconstruct the exact inputs behind an allocation six months later, you can’t evaluate it. The config settings, the candidate list, and the rebalancing schedule are your reproducibility record.
Verify the download. Check the SHA-512 of the installer against the value published on the downloads page — the same discipline applies to your data pipeline.
FAQ
Can I automate rebalancing with free data sources? RSJ Portfolio supports several data providers; you configure the provider in the application. The product information does not specify which providers are free, so check the Data and Currencies page for the supported list.
How often should I rebalance using end-of-day prices? The optimal frequency depends on your strategy and transaction costs. RSJ Portfolio does not enforce a schedule; you can run the optimizer whenever you update your data. Many long-term investors rebalance quarterly or annually.
Does RSJ Portfolio support multiple currencies? Yes, the product includes a conversion path for portfolios quoted in several currencies. You set your local currency in the configuration, and the tool handles conversions using the data provider’s rates.
What if I want to use a different risk model? RSJ Portfolio offers eight risk models and multiple return models. You can select the risk estimator that fits your objective — for example, semi variance for downside risk or conditional value at risk for tail risk.
Conclusion: From Manual Grind to Automated Discipline
Manual rebalancing doesn’t fail because the arithmetic is hard. It fails because it isn’t reproducible. When every quarter brings a slightly different spreadsheet and a slightly different date range, you lose the ability to tell a good allocation from a lucky one.
Automating the pipeline over historic end-of-day prices fixes that. You configure the provider, cache, currency, date range, and cleaning rules once. You build a candidate list deliberately. Then you run the same optimizer — same objective, same risk estimator, same constraints — on a schedule and read the recommendation. The result is consistency, allocations that reduce correlation, and a portfolio whose volatility is lower than the sum of its holdings suggests.
RSJ Portfolio is the practical tool for this: a Windows desktop application with a single user license, available on the product site and via the downloads page. Download the installer, verify the SHA-512, and follow the Getting Started guide to set your starting parameters.
For deeper material, the full user guide covers installation, selection, recommendation, configuration, and the statistical concept behind it all — and there’s a short explainer video if you’d rather watch the walkthrough first.
Related posts
- Portfolio Optimization Tool Pricing: Single User License
- Is Your Optimized Allocation Overfit? A Practical Checklist
- What Is Hierarchical Risk Parity? A Plain-Language Explanation