Strategy Portfolio
A basket of specific strategies discovered in the Mass Test. The portfolio re-tests them, charts them together and measures the effect of diversifying: the sum of several weakly correlated strategies usually has a smaller drawdown than any of them alone. It opens from the Portfolio menu in the main window.
How to add a strategy
Portfolios are multiple and named; if you create one with a name that already exists, the system warns you so you do not overwrite it.
What gets stored
For each strategy it stores its source symbol and timeframe, the metrics shown (a snapshot) and everything needed to re-test it: the specific entry/exit conditions, direction, TP/SL, MaxAnd, point value and commission.
The Portfolio window
A grid lists every strategy with its columns: Symbol · TF · Strategy · Trades · Net P. · Win% · Net P% · Max DD% · P.F. · AvgT%. That is where you manage the portfolio:
Each strategy stores where it came from, but you can override the underlying or the timeframe it runs on (an origin + reassignable model). Marked with *.
Include or exclude strategies from the run without deleting them.
Re-tests every active strategy on its effective symbol+TF (loading the BIN and resampling where needed) and recomputes the metrics live.
Opens the portfolio's combined equity window.
Generates the selected strategy's EasyLanguage code, ready for TradeStation. No need to go back to the Mass Test to export.
Generates the selected strategy's MQL5 Expert Advisor, for MetaTrader 5.
Generates the selected strategy's ProRealTime (ProOrder) code, for ProRealTime.
Generates the selected strategy's AmiBroker formula (AFL), with native stops (ApplyStop).
At the top, the header with the portfolio selector and the actions: Run, Chart, Save, Export ▾ (the six platforms) and More ▾ (optimize exits, Multi-TF, scatter plot, reassign symbol / TF and Position Size).
Below it, four figures at a glance: active strategies, net profit (the sum of the active ones), the worst drawdown and the health since deployment: how many have deteriorated and how many need watching. Each row also carries its health dot, the same traffic light as the Health window: green, amber, red, or grey while there are still too few trades. The dot appears when you press Run.
Click a strategy and its card appears on the right: the equity curve (the stretch since deployment, in colour), the main figures, the confidence and the AQL rule, with buttons to open Performance, edit the AQL, run Walk-Forward on it or export it.
The List, Equity, Trades and Correlation buttons switch the view. At the foot of the list, the totals: strategies, active, net, and the best and the worst.
Each column gets only the width it needs and the strategy name gets the rest, so it does not get cut off mid-rule while a narrow column like Origin takes up as much room as Net P. Click the header to sort: text starts ascending and numbers descending, which is what you expect from "sort by name" versus "sort by profit".
With the keyboard: ↑ ↓ move the selection, Home and End jump to the ends, and the space bar enables or disables the selected strategy. The ordering is only a matter of the view: the buttons keep acting on the row you see selected, however you have sorted it.
⚡ The Actions menu: the same one in all six windows
What you can do with a strategy does not depend on the window you found it in. It would be easy for it to depend on that —each window with its own handful of actions: fifteen here, seven there, four somewhere else—, and then you would have to ask yourself a question that should not exist: "to run a Walk-Forward on this strategy, which window do I have to open it in?".
There is one single menu. Right click any strategy —or the ⚡ Actions button— and the same ones come up, grouped:
Performance · AQ Contrast · 360 Analysis
Survival Test · Walk-Forward
In the Strategy Lab · The exits only
Edit AQL · Save to the Library
EasyLanguage · MQL5 · ProRealTime · AmiBroker · TradingView (Pine)
Add to the Portfolio
A strategy sealed by AQ Genesis can be exported to TradingView, validated with Walk-Forward or dissected with AQ Contrast without first taking it through the Strategy Lab. The Portfolio offers 14 actions; the Library, 14; the Seasonal Optimizer, 13 — and there the actions apply to the whole plan (a strategy with its windows joined by OR), so a seasonal plan can be exported and validated like any other strategy.
That is deliberate: a menu that changes shape in every window has to be relearned every time; one that is always the same is learned once. The only case today is the 360 Analysis outside the Strategy Lab — two of its four phases need the full sweep's candidates, so it would give half a report there. PBO does not appear either: it is not an action on one strategy, it analyzes the whole sweep.
Four Strategy Lab actions keep a local version for a specific reason: Performance and AQ Contrast reuse the series it already has loaded instead of reopening the file (with 1-minute data that is millions of bars), and its Walk-Forward can re-optimize from the search template on each window, which cannot be done from outside.
The portfolio's equity chart
On a real date time axis, it draws each strategy's equity and the combined curve (the sum of the ticked ones). Two tabs at the foot: Chart and Trades.
Side bar (always visible)
- →One row per strategy: a color swatch (matching its curve), a Strategy N checkbox and its net profit (green/red).
- → A tooltip with the full condition on hover.
- →All / None buttons and Correlation matrix.
- → Ticking or unticking recomputes the combined curve instantly.
Summary and crosshair
- →A strip at the bottom with the portfolio summary (ticked ones): net profit, Max DD $ and %, return, trades, PF, Win%.
- →Crosshair: as you move the mouse, guide lines plus a readout of the date and the combined equity at that point.
- → Double-buffered rendering: crisp and flicker-free.
Profit by day
A grid with the P&L aggregated by day. For every ticked strategy it shows two columns —Simple (that day's) and Cum. (cumulative)— and at the end Total Simple / Total Cum. Each strategy's header carries its color; the amounts are green (profit), red (loss) or gray (zero).
Correlation matrix
It measures how the strategies' equities move together (Pearson on daily changes). It lets you spot redundant strategies and keep the ones that genuinely diversify. The heatmap:
The two strategies win and lose at the same time → they contribute the same thing. Candidates for pruning.
Independent behavior. They diversify reasonably well.
One covers the other's falls → the best diversifier for cutting the combined drawdown.
Shared account: all of them in one account
The combined curve adds up each strategy as if it had its own money. In reality they share one account: if ten strategies want to enter at once and the capital is only enough for three, seven are left out, and what one wins or loses changes the size of the others. The Shared account view simulates that.
It uses the trades from the last run (if you have not pressed Run, it does it for you) and passes them one by one, in time order, through a single account: at each instant the trades that close go first, freeing capital, and then the new ones enter. Each entry is sized with its strategy's Position Size on the common capital (normalized ones trade 1 contract). If it does not fit, it is rejected entirely, and the reason and what it would have made are recorded.
- Starting capital of the account.
- Position size is based on current capital, always the starting capital, or the starting capital plus half of the profit.
- Capital that counts for size and limits: closed P&L; closed P&L minus the risk to the stop of the open positions (more prudent); or closed P&L plus what open positions are making or losing at the last close, as the broker does (the default).
- Size of each trade: each strategy's Position Size, or equal risk, where all of them risk the same % of capital to their stop, in whole contracts. If one contract already risks more than that %, the signal is not taken («Size 0») and the reading warns about it.
- Drawdown brake: every X% of drawdown of closed P&L from its peak, Y% less size on top of the previous step, like the Turtles. With «every 10%, 20% less», after a 10% drawdown size is at 80%; after 20%, at 64%, and so on. It grows back as the account recovers. X = 0 turns it off. The reading compares the account with and without the brake. With whole contracts, 1 contract cannot be cut in half: if the cut goes beyond 50%, that signal is not taken. If that leaves the account unable to trade for good, the reading warns you with the date.
- Positions at once and per symbol (0 = no limit).
- Maximum loss per strategy and session day ($, 0 = no limit): once what a strategy has closed in the session reaches that loss, it opens nothing else until the next session; whatever it already has open exits as usual, with its stop and its exit. The session is the contract's and is worked out from its data: on CME it ends at 16:00 Chicago time, so a 17:00 bar already belongs to the next day, whatever time zone your data are in. Skipped entries appear under «Rejected signals» as «Daily loss cap». Use it to simulate the same limit you set in your execution platform.
- Maximum open risk: the sum of the risk to the stop of all open positions, as a % of capital.
- Control margin: untick it to simulate with no margin control at all; neither the maximum margin nor the maintenance margin counts, although their values are kept. When ticked, the reading compares the account with and without control: net result, worst drawdown and how much margin it would need.
- Maximum margin committed, as a % of capital (100 by default). Each contract's margin is the one in its Quote Manager card: the intraday one on entry and the overnight one at the session close. Positions that do not fit overnight are closed at that price and appear in «Rejected signals» as «Closed by overnight margin», with what was given up (or saved) compared with the whole trade.
- No margin in the Quote Manager: a % of notional for those contracts (100 = unleveraged stocks, 50 = margin account), or 0 so they use none. The reading warns which symbols have no margin.
- Intraday margin only from 8:30 to 15:00 Chicago time (like IB): ticked by default. Unticked, intraday margin applies from entry until the session close, at any time of day (more generous than IB).
- Maintenance margin, as a % of the margin the positions use (90 by default; 0 = no margin calls). At each day's close, if the marked-to-market account does not cover it, the lowest-priority positions are closed at that close until it is covered, as in a margin call. They appear in «Rejected signals» as «Closed by margin call». Your broker would do it on the spot, not at the day's close: in reality it would happen earlier and, often, at a worse price.
- Two strategies on the same symbol: independent, netted (a long and a short cancel out, as at the broker) or only one at a time.
- If they enter at once, first the most trusted one or the highest in the list.
- Risk of strategies without a stop: their worst 5 % adverse move (MAE) or k × ATR.
- If it does not fit, enter with fewer contracts instead of rejecting it.
- The account curve (closed and marked to market at each daily close) against the summed one. Click the legend to show or hide each curve; the summed one hides itself if its scale would flatten the account.
- The account's worst drawdown, shaded on the chart, in $ and as a % from the peak, and the strategy that contributed most to that fall.
- By strategy: signals, taken, rejected and the main reason, average contracts and margin, what it made in the account, what its rejected signals would have made, its share of the worst drawdown and its worst day (hover to see the date).
- Trades per day of the portfolio: the average per session day, the % of days on which no strategy trades and the most in one day. And the portfolio's worst day in $, with its date. Every session day with data between the first entry and the last exit counts.
- Account usage over time: margin and open risk as a % of capital, and open positions.
- Correlation of each strategy with the rest of the account, on all days and on down days: high on down days = it falls together with the others and does not protect.
- Rejected signals: date, strategy, reason, contracts and what each one would have made (the first 3,000).
- If the account runs out of capital, it says so: from then on nothing else is taken.
- If there are margin calls: on how many days, how many positions were closed and what it cost (or saved) compared with letting them run.
- With the brake: on how many entries it acted, how much it cut at most, and the net result and worst drawdown with and without it.
- Robustness (tab next to «Rejected signals», «Analyse robustness» button): three tests with your settings, in the background and with «Cancel». Capacity: the same account with 7 capitals (from a quarter to 16 times yours) and 4 position limits; each cell gives the net result, the worst drawdown and the rejected signals, and the reading says from which capital nothing is rejected any more and below which it is ruined. Sensitivity to priority: 50 random entry orders; if the net result changes a lot from one to another, the result depends on who enters first. Account Monte Carlo: 1,000 histories reordering 20-day stretches of its daily curve, with the typical final capital and worst drawdown, the worst 5% and the probability of losing more than half. Reordering stretches keeps short streaks, but not long crises.
- With and without margin (tab, with «Control margin» ticked and a maximum or maintenance margin): the same account with and without margin control, side by side, with the difference: net result, annual return, worst drawdown, profit per dollar of drawdown, rejected signals, maximum margin (in $, as a % of starting capital and versus what the account was worth that day), typical margin, days when the account did not cover maintenance and positions closed by margin. Below, plain-language comments and a conclusion. Save report saves it as an HTML page to open, print or send; Copy gets it ready to paste into a spreadsheet or an email. Check margin bar by bar reads each strategy's bars again and goes through the account at every instant when any asset has a new bar, valuing each position with the close of its latest bar: a 5-minute one moves every 5 minutes and a daily one, once a day. That way moments that do not coincide are never put together. If at some instant the account does not cover maintenance, the lowest-priority positions are liquidated at that bar's price, as the broker would do. The table adds the «With control (bar by bar)» column and the comments say which margin calls were not visible at the daily close. With daily data it gives the same as the daily close, and says so.
- Out of sample (tab, «Analyse out of sample» button): would you have chosen these strategies without knowing the future? History is split into periods (12 months by default) after a minimum seen (36). In each period only the strategies that with what had been seen so far were winning with at least 20 trades go into the account; or only the best 3, 5 or 10 by RoMaD, net or PF. The account is simulated in one go, without cuts, and compared with the same rule applied while knowing the future (choosing with the whole history): the difference is what not knowing it costs. It is shown period by period, with both curves and how often each strategy goes in. Below, the PBO of the rule: out of 12 ways of choosing, each with its own walk-forward, the probability that the one that comes out best is so by luck. Careful: if the strategies were found looking at the whole history, they also «know» the future; this only measures the choice among them.
They are two different controls. The maximum margin decides what gets in: when a trade opens, the margin of all open positions plus the new one cannot exceed that % of the account. Maintenance decides what has to be closed: at each day's close, the marked-to-market account (closed P&L plus what open positions are making or losing) must cover that % of the margin they use. If it does not, that is a margin call and the lowest-priority positions are closed.
A $100,000 account, ES with $15,000 overnight margin, 100% maximum margin and 90% maintenance:
- On entry: 6 contracts fit ($90,000 of margin). The 7th would need $105,000 and is rejected.
- With the 6 open, maintenance is 90% of 90,000 = $81,000.
- The open positions lose $20,000: the marked-to-market account is worth $80,000, less than 81,000. Margin call.
- 1 contract is closed: margin $75,000, maintenance $67,500, now covered by 80,000. Nothing else is closed.
Does an open profit give margin to open more? At a real broker, yes: in futures open P&L is settled every day and available margin is calculated on the marked-to-market account. That is why «Capital that counts» comes set to Closed + open P&L (like the broker): an open profit lets more in, and an open loss, less. The broker also watches the account in real time; AniQuant checks maintenance at each day's close and, with Check margin bar by bar («With and without margin» tab), at the resolution of your data. With «Closed P&L», open positions do not count on entry: it is more prudent with profits, but it lets in trades the broker would not allow with open losses.
With unlimited capital, no limits and 1 contract, the account gives exactly the summed curve; and with a single strategy, exactly its backtest with its Position Size. We checked it to the cent. When the account departs from the sum, it is because of the signals that do not fit and the sizing on the common capital: exactly what the sum hides. The settings are saved with the portfolio when you press Save.
Margin is constant for the whole history (in 2008 or 2020 it was much higher). Marking to market happens at each session close; intraday is not measured. The «worst 5 % adverse move» of strategies without a stop is computed over their whole history.
Combine strategies with low correlation to each other (green/gray in the matrix). Tick and untick in the side bar and watch the combined Max DD fall against the sum of the individual ones: that is the real benefit of diversifying. The Trades tab shows you which days each one contributes.
AniQuant can be tried free for 14 days, with every module and no card. If you have the book, 30.