Stock Strategy Backtester
Sign in with Google

How to use the backtester

Everything you need to build, test and compare stock strategies on Oslo Børs.

Getting started

The screener and data pages are open to everyone. To run backtests, sign in with your Google account: the account is free and gives you 5 backtests a day, and the count resets at midnight Oslo time.

Pick your language in the top bar. When you are signed in, the choice is saved to your account.

Your first backtest

  1. Open Strategy and choose a strategy under Start from a preset.
  2. Press Run backtest. The result appears next to the form after a few seconds.
  3. Change a filter, run again and compare. When you like a strategy, press Save as favourite.

Building a strategy

A strategy is a set of filters and a ranking rule. On every rebalance day the backtester finds the stocks that pass all your filters, ranks them, and holds the top ones in equal weight until the next rebalance.

Period & money
Choose the start and end dates, the currency, your starting capital and the commission in basis points (10 bps = 0.1% of each trade). Tick Include slippage to also pay the bid-ask spread and market impact, which grows when you trade a large share of a stock's normal daily turnover.
Universe
Test on all stocks on Oslo Børs or only on tickers you pick. Minimum price, turnover and history remove stocks that are too small, too illiquid or too new to trade realistically. Leave a field blank to turn it off. The same rules define the benchmark.
Entry filters
Tick a filter to turn it on: trend (fast moving average above slow), price above a moving average, momentum, RSI, maximum volatility and minimum dividend yield. A stock must pass every filter you turn on.
Beta & fundamentals
Press Add filter to set a minimum and/or maximum for beta, P/E, P/B, EV/EBITDA, net debt/EBITDA, return on equity, profit margin or market cap. A stock without a value fails the filter. Fundamentals are available from around April 2023, so in earlier periods these filters exclude most stocks.
Portfolio
Rank by decides which of the passing stocks you buy, Max positions how many you hold, and Rebalance how often the portfolio is rebuilt: monthly, weekly or daily. More frequent rebalancing means more trades and higher costs.

Choosing another currency changes your returns through the exchange rate, but not which stocks are picked: signals always use the stocks' prices in NOK.

Reading the results

Each result is compared with a benchmark: every stock in your universe held in equal weight, with no filters and no trading costs.

Total return
How much the capital grew over the whole period, including dividends and after costs.
CAGR
The average yearly return. Use it to compare periods of different length.
Sharpe
Return per unit of risk: the annual return divided by the volatility, without a risk-free rate. Higher is better.
Max drawdown
The largest fall from a peak to a later low. It shows how painful the worst period would have been.
Volatility
How much the value moves from day to day, annualised. Lower means a smoother ride.
Turnover / year
How many times a year the whole portfolio is traded. High turnover means high trading costs.

Below the numbers are the equity curve against the benchmark, the drawdown chart, the stocks held on the last day, the stocks held most often, and the trading costs paid. Your latest runs are listed under Recent runs so you can open them again.

Check the data coverage note under the results. If a metric is missing for many stocks, a filter on it mostly excludes stocks for lack of data rather than on merit.

Screener

The screener lists every stock on Oslo Børs with price, returns, risk, beta and fundamentals. Click a column heading to sort, search by name or ticker, pick a sector, and add minimum and maximum filters on any column.

Set As of (blank = latest) to a past date to see the market as it looked then, using only data known that day. Press Backtest these filters to turn the screen into a strategy, or Download CSV to save the table.

Stocks marked Data warning had a suspicious price jump in the last year, often a split the data source hasn't adjusted for. Their returns and ratios may be wrong.

Favourites

Press Save as favourite on the Strategy page to keep a strategy. Saving again under the same name overwrites it.

The Favourites page shows each strategy with its latest result. Run reruns it with the newest data (this counts as a backtest); you can also open it for editing, or delete it by clicking Delete twice.

Data

Pick a ticker to see its price chart, daily prices, dividends and splits, beta against OSEBX and annual figures. The fundamentals table shows from which date each annual report is used in backtests. Yahoo's current key figures are shown for comparison only.

How the backtest works

  • No look-ahead: decisions use data up to the close of one day and are traded from the next day.
  • Figures from an annual report are used from 90 days after the fiscal year end, when the report has been published.
  • Returns include dividends and are adjusted for splits. Obvious price errors, such as zero prices and one-day spikes, are removed.
  • Commission is charged on every trade; slippage only when you turn it on.
  • Prices come from Yahoo Finance and are updated every weekday evening.

Limits and caveats

  • Companies that were delisted are not in the data. This survivorship bias makes results look somewhat better than reality.
  • Prices go back about 10 years; fundamentals only to around 2023.
  • Taxes are not included.
  • Backtests are simulations on historical data, not investment advice. Past results don't guarantee future returns.

Feedback

Something doesn't work, or you have an idea? When signed in, press Feedback in the top bar. It goes straight to the developer.