Output and Reporting

Output and Reporting

Output modes

Specify one or more output modes with --output-mode:

ModeDescription
summaryPerformance statistics
tradesDetailed trade list
graphASCII equity curve with time-proportional X axis (for futures contracts, margin requirements are overlaid on the same graph)
returnsMonthly/yearly return matrix
configParsed configuration display
allAll modes combined
silentNo output

Combine modes with commas: --output-mode summary,graph,returns

Reading the summary report

The summary report includes these key metrics:

MetricDescription
Net ProfitTotal realised profit after costs
Total TradesNumber of completed round-trip trades
Win %Percentage of profitable trades
Profit FactorGross profit / gross loss
Avg TradeAverage profit per trade
Max DrawdownLargest peak-to-trough equity decline
SharpeAnnualised risk-adjusted return (Sharpe ratio)
SortinoLike Sharpe, but only penalises downside volatility
NP/DDNet Profit divided by Max Drawdown
R-SquaredLinearity 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, 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.

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 symbol
  • Best/Worst Symbols (Long) – ranked by aggregated long-only profit per symbol
  • Best/Worst Symbols (Short) – ranked by aggregated short-only profit per symbol
  • Best/Worst Trades – the 10 most profitable and 10 least profitable individual trades, showing symbol, strategy, and profit

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.json

Each 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 --orders

When --orders is active:

  • The default --date-from is set to 2 years ago from today (instead of 2010-01-01), since only recent state matters. Override with --date-from if needed.
  • Normal output (summary, graph, returns) is suppressed. Override with --output-mode to 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.