When a Backtest Returns No Results

What to check, in order, when a backtest or exploration in AmiBroker comes back empty
Published Nov 6, 2026 | Amibroker

An empty backtest is almost never a broken strategy. It's usually a setting: the wrong bar interval, a date range with no data in it, a filter that leaves nothing, or not enough buying power. Check them in this order. Each step is small, so you find the cause quickly.

1. Run it on one symbol

Start small, so a run takes seconds instead of hours.

  • Open a chart of a symbol you know is in your database, like SPY.
  • In the Analysis window, set Apply to to Current and Range to All quotes, or a From-To range you know has data.
  • Click Backtest.

If one symbol gives trades, skip to step 2. If not, work through these:

Is there 1-minute data?

  • Switch the chart to 1 minute. You should see 1-minute bars.
  • If the intraday intervals are greyed out, the database was created with an End-of-day base interval. File > Database Settings shows it. Create a new database with a 1 minute base interval and import the data again. Downloading Massive Data into AmiBroker walks through it.

Did the formula run?

  • A mistake in the formula shows as an error in the Analysis window, with the line it's on. A missing file in an #include line is the most common one: the path in it has to point at the folder with your shared_variables.afl.
  • Fix any error before looking at the settings.

Error 29: variable "mk_vol" used without having been initialized. MK_Vol, and every other MK_ variable, is set in mabekit.afl, which your strategy loads through shared_variables.afl. This error means AmiBroker ran your strategy without them. Check:

  • The strategy's first lines still have the #include line for shared_variables.afl. If you copied only part of a strategy into a new file, it may be missing.
  • shared_variables.afl has the #include line for mabekit.afl, not commented out with //, and its path points at the mabekit.afl in your MabeKit folder.
  • Both files are from the same MabeKit download. An older mabekit.afl may not have a variable a newer strategy uses.

Is the periodicity 1 minute?

  • In the Analysis window, click Settings. On the General tab, Periodicity must be 1 Minute for a strategy written for 1-minute bars, like the AFL generator's.
  • A wrong periodicity often gives no trades at all, with no error. An opening range strategy that waits for minute 10 never sees minute 10 on 3-minute bars (9:30, 9:33, 9:36, 9:39, ...), and on daily bars there are no minutes at all.

Is the Range right?

  • 1 recent bar or 1 recent day backtests only the last bar or day, and usually finds nothing. A new Analysis window can start with one of these.
  • From-To dates outside your data give nothing. If you downloaded from January 2025, a range in 2024 is empty.

Do the strategy's own filters let anything through?

Most strategies only trade when a stock passes their filters: a minimum gap, a price range, an average volume. On a symbol like SPY those can easily leave nothing.

  • The generator's ORB strategy, with its default 1% minimum gap, traded SPY 3 times in ten months. SPY rarely gaps 1%. With the gap filter off, it traded 135 times.
  • A minimum price above the symbol's price, or a minimum volume above its volume, gives zero.

To see which filter blocks a symbol:

  1. Click Explore instead of Backtest.
  2. In the generator's strategies, set the Exploration Filter Mode parameter to NONE, so every bar is listed, not just the bars around a trigger.
  3. Each filter's column is green where it passes and pink where it fails.

With the default NEAR_TRIGGER mode, an exploration with no triggers is empty too.

Also check the time window: a Latest Trade Time earlier than the setup can happen (say, 5 minutes for a 10-minute opening range) leaves nothing to trade.

2. Run it on a handful of symbols

Once one symbol works, try five or ten:

  1. Put them in a watchlist: select them in the Symbols window, right-click, and add them to a watch list.
  2. Set Apply to to Filter, and in the filter's Include tab pick that watchlist.

If this gives nothing but one symbol worked:

  • Check the watchlist really has symbols in it. An empty watchlist runs nothing.
  • Check the symbols pass the strategy's filters. A watchlist of stocks under 5 dollars with a 5 dollar minimum price trades nothing.

3. Check the buying power

With many symbols, the backtest's account matters. Each trade needs money, and when the account runs out, AmiBroker skips the trades it can't afford. Worse, when one entry can't be afforded, AmiBroker skips every later signal on that same bar.

On six small caps over about two years, with its filters loosened, the same strategy gave:

Settings Trades
Initial equity 100,000 410
Initial equity 1,000 12
Max open positions 1 311

A strategy that sizes each trade by its risk (for example, 100 dollars risked on a tight stop) can need a large position for one trade.

To take buying power out of the picture while you test a strategy, open Settings in the Analysis window:

  • General tab: set Initial equity very high, e.g. 100,000,000.
  • Portfolio tab: set Max. open positions high, e.g. 1,000.

That shows every trade the strategy would take. Size the account realistically later, when you test how you'd actually trade it.

4. Then the whole market

When a handful of symbols works, set Apply to to All symbols. If that comes back empty:

  • Check the data: were all the symbols imported, for the dates in your Range? Open a chart of a stock that should have traded.
  • Run a shorter range first, like one month. A 1-minute backtest over thousands of symbols and years of data takes a long time, and an hour with no output can look like "no results".
  • Check the buying power again (step 3). It matters far more across thousands of symbols than across a handful.

When a run sits at 0%

If a backtest or exploration runs for many minutes and stays at 0%, even over one day, find out whether the time goes to your strategy or to AmiBroker itself. Save this as a new formula. It does nothing useful: one trade and one row per symbol, and no #include, so none of MabeKit runs.

Buy = Status( "firstbarinrange" );
Sell = Status( "lastbarinrange" );
Short = Cover = 0;

Filter = Status( "lastbarinrange" );
AddColumn( C, "Close" );

With the same Apply to and Range as your strategy, click Backtest, then Explore. Both should finish.

  • If they finish quickly, AmiBroker, your data and your PC are fine, and the time goes to the strategy. Add your strategy's #include line at the top of the test formula and run it again, to see how much of the time is MabeKit's variables. Then cut the run down: one symbol, then a handful (steps 1 and 2).
  • If they're slow too, the strategy isn't the cause. Check how many symbols Apply to covers, and that Range is what you expect, then send me what you see (below).

A one-day run doesn't take a fraction of a one-year run's time. A strategy that uses averages like 10-day or 3-month volume still reads months of data before the first day in the Range, for every symbol.

When trades start later than your data

Your chart shows data back to the day you downloaded from, but the backtest's first trade comes days or weeks later, even with Range set to All quotes. That's usually the strategy waiting for enough data to calculate its indicators. MK_Vol, the 10-day average volume, has no value until there are 10 days of data before the bar. A filter on a value that isn't there yet can't pass, so there are no trades until then.

For example, with data from Tuesday, October 20, the 10 trading days from October 20 to November 2 come first, and the first trade can't come before November 3.

To see it for yourself, open a chart of SPY, set Apply to to Current and Range to All quotes, and use the test formula from the section above:

  1. Click Backtest with the test formula as it is. Its first trade is on the first day of your data, so AmiBroker sees the whole range.
  2. Replace it with this, using the #include line from your strategy, and click Explore. It lists one row per day:
#include "e:\\demo-advanced\\shared_variables.afl";

Buy = Sell = Short = Cover = 0;

Filter = Day() != Ref( Day(), -1 );
AddColumn( MK_Vol, "MK_Vol" );
AddColumn( MK_Vol3M, "MK_Vol3M" );

MK_Vol is empty for about the first 10 days, and your strategy's first trade can't come before it has a value. MK_Vol3M, the 3-month average, is empty for about 3 months. A strategy that uses it waits that long.

The fix is more data: download from a few months before the first day you want trades for, so the indicators have their history by then.

When a backtest gets to 100% and then stops responding

A backtest reaches 100%, and then AmiBroker stops responding, sometimes for many minutes. It's usually still working: after 100% it adds the MabeKit columns to each trade, on a single thread. Backtest Run Time and Trade Count shows both phases of a backtest, with the CPU and memory each one uses.

When it takes hours or gives fewer trades than you expect

A backtest over thousands of symbols can take hours, and a low Max. open positions can leave far fewer trades than the strategy's signals. See Backtest Run Time and Trade Count.

Still stuck?

Send me:

  • the strategy's AFL,
  • a screenshot of the Analysis window's Settings (General and Portfolio tabs),
  • what you set Apply to and Range to,
  • what you got on one symbol.