Backtest — User Guide
The Backtest tab lets you replay an AIM strategy over real historical prices and see how it would have performed — without saving anything. It's a what‑if sandbox: you enter a symbol and a few parameters, pick a date range, and get a full report (return vs. just holding, trades taken, drawdown, and a trade ledger).
Historical prices come from one of two providers:
- Binance — for crypto pairs (e.g.
BTC/USDT). No key needed. - Twelve Data — for stocks, metals, and forex (e.g.
AAPL,XAU/USD). Requires a free API key (see below).
1. Get a Twelve Data API key
You only need this for stocks / metals / forex backtests. Crypto (Binance) needs no key.
- Go to https://twelvedata.com and click Sign up (Google/email; free).
- Confirm your email and sign in.
- Open your Dashboard → API Keys. Your key is shown there — copy it.
It looks like a 32‑character string, e.g.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
What the free ("Basic") plan covers
- Limits: 8 requests/minute, 800 requests/day — plenty for backtesting.
- Included: US stocks (e.g.
AAPL,MSFT), goldXAU/USD, many forex pairs. - Not included: some symbols need a paid plan — notably silver
XAG/USD("available starting with the Grow or Venture plan"). You'll see a clear message in the report if a symbol isn't on your plan.
Optional: Alpha Vantage (commodities & more)
There's a second optional provider, Alpha Vantage (free key at https://www.alphavantage.co/support/#api-key), which adds commodities (WTI, Brent, copper, etc.) alongside stocks, crypto and forex. Its free tier is much more limited (~25 requests/day, ~1 request/second), so use it mainly for things the other providers don't cover. When you choose Alpha Vantage as the data source you also pick a market (stock / crypto / forex / commodity).
On the free plan, only the 1 day and 1 week intervals are supported — the 1 hour / 4 hour (intraday) feeds are a premium feature, so pick 1d or 1w for Alpha Vantage. Also, the daily stock/forex feed returns only the latest ~100 points (≈ 5 months); for a longer history use 1 week (weekly, crypto and commodity feeds return full history free), or keep your date range recent.
Indian stocks (BSE)
Pick Data source = Alpha Vantage, market = Indian stock — BSE, and a
1 day / 1 week interval. Type the company's BSE ticker — a bare name like
RELIANCE, TCS, INFY, HDFCBANK is fine (the .BSE suffix is added
automatically; RELIANCE.BSE also works). (NSE coverage on Alpha Vantage is
unreliable, so this uses the BSE listing.)
2. Enter your key(s) in the app
Open ⚙️ Settings → Data and paste your key into Twelve Data API key (and/or Alpha Vantage API key). Keys are saved in your browser and persist across sessions, so you only need to do this once per device.
3. Run a backtest
- Open the 📈 Backtest tab.
- Symbol — type the instrument:
- Crypto:
BTC/USDT,ETH/USDT, … (Binance) - Stock:
AAPL,MSFT, … (Twelve Data or Alpha Vantage) - Metal/forex:
XAU/USD(gold),EUR/USD, … (Twelve Data) - Commodity:
WTI,BRENT,COPPER, … (Alpha Vantage → Commodity market)
- Crypto:
- Data source — auto‑selects based on the symbol (Binance for crypto pairs, Twelve Data otherwise). You can override it; choosing Alpha Vantage also shows a market selector (stock / crypto / forex / commodity).
- Initial cash — the starting cash the strategy deploys (default
1000). The strategy starts with no position and makes its first buy from cash automatically. - AIM parameters:
- Buy safe / Sell safe — the bands (in %) that trigger buys/sells.
- Ratchet pct — share of each sell locked into the control value (0–1).
- Date range & interval — Start date, End date, and Interval (1 hour / 4 hours / 1 day / 1 week).
- Min $ to buy / Min $ to sell — minimum trade size in dollars
(default
10). Recommended trades smaller than this are skipped, which cuts down on tiny, frequent trades. Set to0to disable. - Click Run backtest.
Nothing you enter here is saved — it doesn't create or change any strategy on the Home tab.
4. Read the report
- Headline % — the strategy's total return over the period, with a one‑line verdict comparing it to simply holding (no trades).
- Stat grid:
- Candles — number of price points replayed.
- Trades — buys / sells actually taken.
- Skipped (sub‑min) — recommended trades dropped for being below your Min $ thresholds (raise the minimums to skip more, lower to take more).
- Start / End price, Hold return, Max drawdown, Traded volume, Final cash / qty, End value.
- Trades table — every buy/sell with date, price, shares, amount, and the resulting quantity/cash/total.
Quick reference
| Want to test… | Symbol | Data source | Key needed? |
|---|---|---|---|
| Bitcoin | BTC/USDT | Binance | No |
| Apple stock | AAPL | Twelve Data | Yes |
| Gold | XAU/USD | Twelve Data | Yes (free) |
| Silver | XAG/USD | Twelve Data | Yes (paid plan) |
| Crude oil | WTI | Alpha Vantage (Commodity) | Yes (free) |
| Gold via ETF | GLD | Alpha Vantage (Stock) | Yes (free) |
| Indian stock (BSE) | RELIANCE.BSE | Alpha Vantage (Stock) | Yes (free) |
Alpha Vantage free tier: only the 1 day and 1 week intervals are supported — 1h/4h intraday is premium. Also ~25 requests/day (~1/second), and the daily feed returns only the latest ~100 points.