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.

  1. Go to https://twelvedata.com and click Sign up (Google/email; free).
  2. Confirm your email and sign in.
  3. Open your DashboardAPI 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), gold XAU/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

  1. Open the 📈 Backtest tab.
  2. 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)
  3. 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).
  4. Initial cash — the starting cash the strategy deploys (default 1000). The strategy starts with no position and makes its first buy from cash automatically.
  5. 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).
  6. Date range & intervalStart date, End date, and Interval (1 hour / 4 hours / 1 day / 1 week).
  7. 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 to 0 to disable.
  8. 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…SymbolData sourceKey needed?
BitcoinBTC/USDTBinanceNo
Apple stockAAPLTwelve DataYes
GoldXAU/USDTwelve DataYes (free)
SilverXAG/USDTwelve DataYes (paid plan)
Crude oilWTIAlpha Vantage (Commodity)Yes (free)
Gold via ETFGLDAlpha Vantage (Stock)Yes (free)
Indian stock (BSE)RELIANCE.BSEAlpha 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.