Portfolio

The Portfolio page keeps one set of strategies, taken from any market, and tests them together over one aggregated account. It answers a different question from the Collection page: a collection ranks candidates on their own market, while the portfolio asks what happens to one account when all of them trade at once.

There is one portfolio, and it lives in this browser only. It is not synced to the account, so the toolbar's Export menu is the backup and the way to keep two portfolios side by side ("conservative" and "aggressive" are two files, loaded one at a time). The page has no name to edit: it is simply Portfolio.

Adding a strategy

There are two ways in, and they differ in one important detail: whether the strategy arrives already calculated.

  • Strategy Editor → + Add → Add to Portfolio. The editor runs the strategy once and stores a copy of it with the trades of that run, so the portfolio's figures include it immediately.
  • Collection record card → the briefcase button. A collection record carries no transaction list, so the entry arrives pending: press Calculate to run it inside the portfolio.

Both store a copy. Clearing a market's collection never empties the portfolio, and removing a portfolio entry never touches the collection.

Curating: remove, undo, redo

Removing a strategy is the curation verb — there is no per-record include/exclude toggle, because a strategy that is in the list is in the figures and one that is out is out.

Every change is undoable. Undo and Redo in the toolbar (Ctrl+Alt+Z / Ctrl+Alt+Y) step through the portfolio's history, and each button's tooltip names the step ("Undo: removed strategy #123456 (EURUSD H1)"). Because each entry carries its own trades, an undo restores the exact figures without recalculating anything. The history is not saved: reloading the page starts a fresh one.

Calculate

The page has one Calculate button: it runs every strategy in the portfolio and replaces the figures with the fresh ones. That is also the way to apply an account-settings change, and the way to calculate strategies that arrived from a Collection card. While it runs, the same button becomes Stop; stopping keeps the part that already finished.

Adding a strategy from the Strategy Editor needs no calculation at all: its entry arrives with the trades of the run the editor just made.

A very large portfolio is saved without the trades of some of its strategies when the whole set would not fit in the browser's storage; those strategies come back pending after a reload (the pending count and Calculate's tooltip say so), and one Calculate rebuilds them. The last figures stay on screen in the meantime, because the saved paint cache is not thrown away.

The figures

The Balance card draws one balance line over the merged time axis of every involved market; the Backtest stats card holds the account's figures, and the Portfolio summary card says what the line was built from and when:

  • Before the first calculation the card is not left blank: it draws a flat line at the account's initial balance (the placeholder the Strategy Editor uses) and the line above it says "Not calculated yet — press Calculate". No figure is ever faked as zero: the statistics and summary cards stay hidden until a calculation exists.
  • Closed profit only. The line is equity = balance: it counts closed trades and carries no floating exposure. A live multi-market portfolio does carry floating exposure, so the Balance heading's tooltip and this guide both say it.
  • Aggregate trades counts one trade per close time: when two strategies close at the same moment, that is one event on the account. Included trades is the sum of the individual strategies' trade counts, so the difference between the two rows is visible rather than surprising. A strategy that is still pending has not been run here yet, so it contributes no closes to either count until Calculate.
  • Backtest quality is weighted by each strategy's deal count, so a 5-deal strategy cannot outweigh a 500-deal one.
  • Max consecutive losses is the worst streak any single strategy had. Legs from different markets interleave, so the account's real worst run can be longer — the row is a documented over-estimate.
  • Profit per day, Sharpe ratio, month coverage and stagnation run over the merged axis and publish the nominal minutes per bar the Sharpe annualisation used (portfolio-axis, and the note in the Balance heading); with one market it is exactly that market's period, so a one-market portfolio reduces to the strategy's own figures.
  • Bars in trade, bars in trade % and average position length are deliberately not shown: on a portfolio line they measure the gaps between closes of different strategies, not a holding time.
  • Multi-market profits are converted with the snapshot forex rates of this browser, not historical rates. The saved figures therefore keep the rates they were calculated with: after the rates (or the account currency) change, press Calculate once to re-convert every strategy.

Very long axes (over 500 000 points) are reduced to every n-th bar; every trade is kept, and the chart says so.

Sorting and the OOS switch

The records column sorts by any collection criterion, exactly as the Collection page does — sorting never changes the figures, because the aggregate is over the entry set, not the order. The OOS switch adds each strategy's own out-of-sample line to its card; the portfolio's figures are full-data only (a portfolio result has no out-of-sample window, because the entries' fit boundaries fall at different times).

Filters and correlation

Two cards at the top of the records column work exactly like their Collection-page counterparts, but they belong to this portfolio.

Filters. The switch is off by default. While it is on, only the strategies passing the criteria are listed; the default list is the single criterion Minimum net profit = 0. The heading above the list says Count: 5 shown of 12 strategies, so a filtered list never looks like a lost strategy; when nothing passes, the list says so instead of claiming the portfolio is empty. The filters change the list only: the Balance chart, Backtest stats, Portfolio summary, Markets table, Calculate and the Expert export always include every strategy. Remove failing removes the strategies that fail the criteria. It asks first in the same dialog the page's other removals use, with the count, and the removal is one undoable step.

Correlation. Detection is on by default, with a threshold of 0.98 and automatic resolution on. A strategy whose balance line correlates with a higher-ranked strategy is treated as a duplicate:

  • With Auto-resolve correlations on, an incoming loser is not added; when the incoming strategy wins, the existing loser is removed. The add and the removal are one undoable step, and the toast says what was removed. An import is resolved the same way: a correlated strategy of the file is not stored, and the confirmation says how many before you accept it.
  • With it off, correlated strategies are only marked with the Correlated badge and the card offers Remove correlated.

The card's footer reports Passing correlation n of m. The Portfolio summary card also shows the correlation mode and its detected/resolved counts. Changing a correlation setting so that strategies would be removed asks first, with the count. A stored or imported portfolio may carry a backlog; the card then offers Resolve correlated instead of deleting anything when the page opens. Correlation reads each strategy's own balance line, not the merged portfolio line — and a strategy that has not been calculated yet has no line, so it never correlates.

Markets

The Markets table shows one row per market the portfolio spans: how many strategies it contributes, how many closes, and how much profit. A market whose strategy is still pending, or whose data cannot be loaded, keeps its row with - for the figures it does not have; a market whose data cannot be loaded is skipped by the aggregate, and the page warns that the result is partial.

Import and export

Two toolbar menus sit next to Clear, and they are mirror images of each other.

Import:

  • Portfolio JSON reads a portfolio document back. On a non-empty portfolio it asks first, replaces everything (one undoable step), and ignores the name the file carries: there is one portfolio and it is called Portfolio.
  • Portfolio Expert reads the strategies back out of an MT5 Portfolio Expert Advisor (.mq5). An .ex5 has no source and no strategy list, so the picker accepts the source file only. The entries arrive pending — an Expert Advisor is a strategy set, not a backtest — so the next step is Calculate. This is the Portfolio Expert round trip.

Export:

  • Portfolio JSON writes one document with the sort setting and every strategy plus its trades. It is the backup, and the way to keep two portfolios side by side — the app holds exactly one, so "conservative" and "aggressive" are two files, loaded one at a time.
  • Portfolio Expert MT5 opens the Expert Advisor dialog and downloads the composed .mq5 or the compiled .ex5 (see the Portfolio Expert guide).

A document without trades is accepted — those entries simply arrive pending, and Calculate runs them.

The Portfolio Expert Advisor

Export → Portfolio Expert MT5 composes one MT5 Expert Advisor that trades every strategy of the portfolio on its own market, from a single chart. The dialog shows what the file will do before anything is downloaded: the strategy and market counts against the 50-strategy cap, one row per market with the broker symbol the Expert will trade there, the account-wide settings it bakes once for the whole portfolio, and the two downloads — the composed .mq5 and the compiled .ex5.

Three facts are worth carrying away:

  • Attach it to a chart of one of its own markets — the most liquid one. MT5 sends ticks for the chart symbol only, so every other market is driven from that chart's ticks.
  • The account limits are one set. The open-position and open-lot caps, the daily and equity protections, the news filter and the stats panel belong to the wrapper and apply to every strategy at once; each strategy keeps its own entry amount, its spread limit (in its own market's points) and its features.
  • The file carries no backtest figures. An Expert Advisor is a strategy set, not a backtest, so importing one lands pending strategies and the next step is Calculate. That is also why re-exporting an unchanged portfolio returns the same Expert ID.

The full behaviour — the symbol map and where it is stored, what the file contains, how the Expert behaves in the terminal, what it will not reproduce exactly, and the import round trip — is the Portfolio Expert guide.

The cards

  • Balance draws one line over the merged time axis of every involved market. It is closed profit only: the chart is the realised part of the account, because a live portfolio also carries floating exposure (the heading's tooltip is the on-page reminder, and the same words are announced to a screen reader). The line's card holds nothing but the chart; the axis note (points and nominal period, or a "reduced resolution" warning) sits in its heading row.
  • Backtest stats is the account's performance as one table: net profit, drawdown, return to drawdown, the daily/monthly/stagnation group, quality, Sharpe, profit factor, system quality and R-squared. These are the figures of the merged balance line.
  • Portfolio summary is the composition and the provenance, with no performance figure in it: the number of strategies, markets, the two trade counts (aggregate and included), the initial account, when the aggregate was last calculated, and the correlation mode with its detected/resolved counts. A short portfolio is not a shortfall, so the capacity is not printed beside the count.
  • Markets gives one row per market: strategies, merged closes and the profit that market contributed.

The status facts of the earlier design are in those places now: the counters live in the toolbar, the storage verdict in the warning line when a write fails, and the axis in the Balance heading.

The balance figure's worth repeating: the portfolio line is the realised part of one account.