Output and Reporting
Output modes
Specify one or more output modes with --output-mode:
| Mode | Description |
|---|---|
summary | Performance statistics |
trades | Detailed trade list |
graph | ASCII equity curve with time-proportional X axis (pass --graph-margin to overlay margin requirements for futures contracts) |
returns | Monthly/yearly return matrix |
config | Parsed configuration display |
all | All modes combined |
silent | No output |
Combine modes with commas: --output-mode summary,graph,returns
Reading the summary report
The summary report includes these key metrics:
| Metric | Description |
|---|---|
| Net Profit | Total realised profit after costs |
| Total Trades | Number of completed round-trip trades |
| Win % | Percentage of profitable trades |
| Profit Factor | Gross profit / gross loss |
| Avg Trade | Average profit per trade |
| Max Drawdown | Largest peak-to-trough equity decline |
| Sharpe | Annualised risk-adjusted return (Sharpe ratio) |
| Sortino | Like Sharpe, but only penalises downside volatility |
| NP/DD | Net Profit divided by Max Drawdown |
| R-Squared | Linearity of the equity curve (1.0 = perfectly linear) |
The trades list
The trades output mode shows every individual trade with:
- Entry date, time, and price
- Exit date, time, and price
- Direction (Long/Short)
- Quantity
- Profit/Loss in currency and points
- MFE (Maximum Favourable Excursion) – the best the trade achieved
- MAE (Maximum Adverse Excursion) – the worst the trade experienced
- Bars held
Per-trade values (slippage, commission, gross and net profit) are shown in the symbol’s native currency. The cumulative running total column is converted to the base (reporting) currency using the FX rate at each trade’s entry/exit time. When the symbol currency differs from the base currency, the FX conversion rate is shown in a column formatted as rate BASE/SYMBOL (e.g. 0.7156 USD/AUD). For combined multi-symbol runs, all monetary columns are converted to the base currency, and two additional columns are appended: Strategy (the strategy name) and Inputs (the non-default strategy parameters, e.g. Period=20,Mult=1.5).
Fills that occurred on shadow bars (out-of-session) are annotated with *.
The returns matrix
The returns output mode shows a year-by-month matrix of returns, making it easy to identify seasonal patterns, drawdown periods, and consistency across time.
The matrix includes all years covered by the backtest date range, even years with no trades. Months that fall entirely outside the backtest period (e.g., months in the start year before the start date, or months in the end year after the end date) are shown as blank cells rather than zeros, distinguishing them from months that were within the active period but had no trade exits. Trades entered during the indicator warmup period (before max-bars-back bars) are excluded from the returns matrix. Months that fall entirely within the warmup period (before the first tradable bar) are also shown as blank cells.
Per-Symbol Breakdown
When running multiple symbols or strategies, the combined summary includes a Per-Symbol Breakdown table showing performance metrics for each symbol. Columns include: Symbol, Description, Margin, Exchange, Days, Hours, TZ, Bar, Trades, % TIM, Slippage, Commission, Long Profit, Short Profit, Net Profit, PF, Max DD, NP/DD, NP/Mar, Win%, Avg Trade, Bars, Sharpe, Strategy, and Inputs. The Long Profit and Short Profit columns show the profit from long and short trades respectively, both converted to the base (reporting) currency. The % TIM column shows the per-run “Percentage Of Time In Market” (post-warmup bars with at least one position open); the Total row’s % TIM is the wall-clock-union value across all runs (true portfolio exposure). For runs that group multiple symbols (e.g. GLD/SPY/QQQ), the Symbol column shows only the primary (Data0) leg.
Combined summary leaderboards
When running multiple symbols or strategies, the summary output mode includes top-10 leaderboard tables:
- Best/Worst Strategies – ranked by aggregated net profit per strategy
- Best/Worst Sectors – ranked by aggregated net profit per market sector
- Best/Worst Symbols – ranked by aggregated net profit per primary symbol
- Best/Worst Symbols (Long) – ranked by aggregated long-only profit per primary symbol
- Best/Worst Symbols (Short) – ranked by aggregated short-only profit per primary symbol
- Best/Worst Trades – the 10 most profitable and 10 least profitable individual trades, showing symbol, strategy, and profit
For slash-grouped runs, “primary symbol” means the first (Data0) leg; rows in symbol leaderboards and the trade Symbol column show only that leg.
Tables are displayed in horizontal rows of at most four tables each. When a config run has a name field, that name is used in the Strategy column instead of the strategy function name.
Exporting trades
Export the trade list to a JSON file for external analysis or portfolio construction:
algo run --strategy kbt --symbols @ES --export trades.jsonEach trade in the exported JSON includes the strategy name (strategyName), non-default strategy inputs (strategyInputs), and FX exchange rate data when the symbol currency differs from the base currency (entryExchangeRate, exitExchangeRate, exchangeRatePair). A convenience field profitBaseCurrency records the trade profit converted to the base (reporting) currency using the exit-time exchange rate. When the symbol and base currencies are the same, profitBaseCurrency equals profitCurrency. If FX data is unavailable, exchange rates and profitBaseCurrency default to 0.0 rather than failing the export.
The exported JSON file can be used with the algo portfolio command to generate HTML reports.
Orders mode
The --orders flag shows a snapshot of current portfolio state: open positions and pending orders for the next bar. This is useful for reviewing what a strategy (or set of strategies) is currently holding and what trades it intends to place next.
# Single strategy
algo run --strategy kbt --symbol @ES --orders
# Multi-strategy config
algo run --config myportfolio.json --ordersWhen --orders is active:
- The default
--date-fromis set to 2 years ago from today (instead of2010-01-01), since only recent state matters. Override with--date-fromif needed. - Normal output (summary, graph, returns) is suppressed. Override with
--output-modeto show both orders and other output.
The output consists of two tables:
Open Positions — all positions currently held at the end of the backtest, showing: strategy name, symbol, direction (Long/Short), entry date, quantity, entry price, current price, and open P&L.
Pending Orders (Next Bar) — orders placed by the strategy on the final bar that would be evaluated on the next bar, showing: strategy name, symbol, order type, execution method, order name, quantity, and price.
Account-equity curve and capital-utilization panel
The graph output mode prints two stacked ASCII panels.
Top panel — Account Equity. Plots initial capital + cumulative closed P&L + open mark-to-market per calendar day, in the base currency. A horizontal reference line is drawn at the initial capital so drawdowns from the starting balance are visible at a glance. Including open mark-to-market means the curve reflects unrealized gains/losses on held positions: long-running futures or stock holds no longer produce a flat curve that suddenly jumps when the position closes.
If a Buy & Hold comparison is enabled (single-symbol runs), the B&H curve is shifted to the same initial-capital baseline and overlaid in cyan.
Bottom panel — Capital Utilization. Three series, all in the base currency:
- Free Cash — account equity minus margin minus stock capital. Represents account value not tied up in open positions or margin.
- Margin — daily futures margin (
qty × MarginPerContractsummed over open futures positions, FX-converted). - Stock Capital — cost basis of open stock positions (
qty × entry_price × pointValue, FX-converted at entry time). Includes locked short proceeds. For futures-only strategies the line is absent; for stock-only strategies the margin line is absent.
A series that is identically zero across the whole run is omitted from the panel so the legend stays meaningful.
The legacy --graph-margin flag is now a no-op: margin and stock capital always appear in the utilization panel when relevant. The flag is kept for backwards compatibility with existing scripts.