Markets and Symbols
Symbol prefixes
Algolang uses prefix characters to distinguish between different asset types:
| Prefix | Asset Type | Example |
|---|---|---|
@ | 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) | Stocks | AAPL (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 descriptionKey flags:
| Flag | Description |
|---|---|
-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 |
-l | Long format with full details |
-1 | One entry per line |
-r | Reverse 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:
| Interval | Description |
|---|---|
daily | Daily bars |
weekly | Weekly bars |
monthly | Monthly bars |
Nm | N-minute bars (e.g., 5m, 15m, 60m) |
Nh | N-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
@SIUsing 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,@CLPortfolio 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/<softsUsing 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:
| Name | Aliases | Contents |
|---|---|---|
metal | metals | @GC, @HG, @PA, @PL, @SI |
soft | softs | @C, @CC, @CT, @KC, @LBS, @OJ, @RM, @SB |
index | indexes, indices | @ES, @NQ, @YM, @VX, and more |
energy | @B, @CL, @HO, @NG, @RB | |
currency | forex, fx | FX futures |
interest | bonds, treasuries | Interest rate futures |
agriculture | grains, ag, agri | Agricultural futures |
meat | livestock, meats | Livestock futures |
crypto | Cryptocurrency 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.