Markets and Symbols

Markets and Symbols

Symbol prefixes

Algolang uses prefix characters to distinguish between different asset types:

PrefixAsset TypeExample
@Futures@ES (E-mini S&P 500), @CL (Crude Oil)
#Commitment of Traders (COT)#088 (Crude Oil COT positions)
%Market Internals%VIX (CBOE Volatility Index)
$Economic Data (FRED)$GDP (Gross Domestic Product)
+Exchange Rates+AUDJPY (Australian Dollar / Japanese Yen)
(none)StocksAAPL (Apple Inc.)

Browsing available symbols

The algo symbols command lists all available symbols. It supports extensive filtering:

# List all futures
algo symbols -t future

# List energy futures
algo symbols -t future -c energy

# List US symbols
algo symbols -y us

# List European symbols
algo symbols -y eu

# Search by description (regex)
algo symbols -d 'crude'

# Long format with full details
algo symbols -l -t future -c metal

# Sort by description
algo symbols -t future --sort description

Key flags:

FlagDescription
-t, --asset <type>Filter by asset type: future, stock, cot, internal, economic
-x, --exchange <name>Filter by exchange (prefix match, case-insensitive)
-c, --category <name>Filter by category (prefix match)
-y, --country <code>Filter by country (ISO codes or names like us, gb, japan)
-d, --description <regex>Search descriptions with regex
-s, --sort <field>Sort by: symbol, description, asset, category, country, currency, exchange, timezone
-lLong format with full details
-1One entry per line
-rReverse sort order

Available market data

Algolang includes data for:

  • 131 futures markets spanning energy, metals, grains, indices, interest rates, currencies, softs, meats, and crypto
  • 42 market internals including VIX, TICK, advance/decline data
  • 5,000+ Commitment of Traders (COT) markets, accessible individually or grouped by 97 sectors
  • US equities
  • Crypto markets
  • FRED economic data (GDP, unemployment, interest rates, etc.)

Futures, equities, and crypto data are available at 1-minute granularity. Market internals are provided as daily bars. COT data is provided in weekly intervals to match its release frequency. FRED economic data varies by series – some are daily (e.g., Fed Funds Rate), some are monthly (e.g., CPI), and some are quarterly (e.g., GDP).

Bar intervals

Bar intervals can be specified as:

IntervalDescription
dailyDaily bars
weeklyWeekly bars
monthlyMonthly bars
NmN-minute bars (e.g., 5m, 15m, 60m)
NhN-hour bars (e.g., 1h, 4h)

All intraday bars are aggregated from the underlying 1-minute data.

Portfolio files

Portfolio files are lists of symbols stored in ~/.algolang/portfolios/. They provide a convenient way to manage groups of related symbols that you frequently backtest together.

File format

Each portfolio file is a plain text file containing symbol names. The format is flexible:

  • One symbol per line
  • Space-separated or comma-separated symbols on a single line
  • Lines starting with # are treated as comments
  • Empty lines are ignored

Example (~/.algolang/portfolios/metals):

# Precious and base metals
@GC
@HG
@PA
@PL
@SI

Using portfolios on the command line

Reference a portfolio on the command line using the < prefix with the --symbols flag:

# Run strategy on all symbols in the 'metals' portfolio
algo run --strategy macrossover --symbols <metals

# Run on multiple portfolios
algo run --strategy macrossover --symbols <metals,<energy

# Mix portfolio references with individual symbols
algo run --strategy kbt --symbols @ES,<metals,@CL

Portfolio names are resolved case-insensitively and aliases are supported (e.g., <metals and <metal both work).

When used with the / separator for multi-leg strategies, portfolio references expand as a cartesian product:

# Each metal paired with @NQ (5 spread runs)
algo run --strategy spread --symbols <metals/@NQ

# Cartesian product of two portfolios (5 metals x 8 softs = 40 runs)
algo run --strategy spread --symbols <metals/<softs

Using portfolios in config files

The < prefix syntax also works in configuration files anywhere a symbol is accepted. See Loading symbols from files in Chapter 12 for details and examples.

Available portfolios

Common portfolio files include:

NameAliasesContents
metalmetals@GC, @HG, @PA, @PL, @SI
softsofts@C, @CC, @CT, @KC, @LBS, @OJ, @RM, @SB
indexindexes, indices@ES, @NQ, @YM, @VX, and more
energy@B, @CL, @HO, @NG, @RB
currencyforex, fxFX futures
interestbonds, treasuriesInterest rate futures
agriculturegrains, ag, agriAgricultural futures
meatlivestock, meatsLivestock futures
cryptoCryptocurrency assets

You can view all available portfolios by listing the directory:

ls ~/.algolang/portfolios/

You can also create your own portfolio files by adding a text file to this directory.