Quick Start

This chapter walks through running your first backtest, reading the output, and exploring the interactive shell.

Running your first backtest

Run a simple moving average crossover strategy on E-mini S&P 500 futures:

algo run --strategy macrossover --symbols @ES --output-mode summary

This command:

  • Runs the built-in macrossover strategy
  • Against the @ES (E-mini S&P 500) symbol
  • Using default settings (daily bars, 2010-01-01 to today)
  • Displays a summary of the backtest results

The summary output includes key performance metrics: net profit, number of trades, win percentage, profit factor, Sharpe ratio, maximum drawdown, and more.

Trying different output modes

Algolang supports several output modes that can be combined:

# Show the equity curve as an ASCII graph
algo run --strategy macrossover --symbols @ES --output-mode graph

# Show every individual trade
algo run --strategy macrossover --symbols @ES --output-mode trades

# Show the monthly/yearly return matrix
algo run --strategy macrossover --symbols @ES --output-mode returns

# Combine multiple modes
algo run --strategy macrossover --symbols @ES --output-mode summary,graph,returns

Changing backtest parameters

Override date ranges, bar intervals, and strategy inputs:

# Test on a specific date range with 60-minute bars
algo run --strategy macrossover --symbols @ES \
    --date-from 2020-01-01 --date-to 2024-12-31 \
    --bar-interval 60m --output-mode summary

# Override strategy inputs
algo run --strategy macrossover --symbols @ES \
    --inputs LenFast=5,LenSlow=50 --output-mode summary

Running on multiple symbols

Use commas to run the same strategy across multiple symbols sequentially:

algo run --strategy macrossover --symbols @ES,@NQ,@CL --output-mode summary

Each symbol runs as an independent backtest and produces its own results.

Using the interactive shell

Launch the interactive shell by running algo with no arguments:

algo

This opens a tabbed terminal interface where you can:

  • Type commands without the algo prefix (e.g., run --strategy macrossover --symbols @ES)
  • Run multiple commands concurrently in separate tabs
  • Use tab completion for commands, strategy names, and symbol names
  • Navigate command history with the up/down arrow keys
  • Use Ctrl+R for reverse history search

Type exit or quit to leave the shell.

What’s next?

The rest of this manual progresses through Algolang’s features in detail:

  • Part II covers core concepts: markets, strategies, price data, orders, and timezones
  • Part III covers running backtests, output, configuration files, and optimisation
  • Part IV covers portfolio management with the Trade Director
  • Part V covers advanced topics: writing strategies, the shell, and performance
  • Part VI provides complete reference material