The MabeKit Column Library

Adding the MabeKit column library to your Amibroker backtest.
Published Dec 8, 2025

Download the Code

Steps for Using the MabeKit Column Library in your Amibroker Backtest

View the video for a walkthrough and demonstration of the process.

  • Download the code using the link at the top of this page.
  • Unzip the archive and place the files in a directory of your choosing (I used e:\demo-advanced in the video)
  • Bring up a new Analysis window in Amibroker, and open the demo.afl file.
  • Important edit the shared_variables.afl file and put the path to your files in the #include lines
  • Run a backtest on the Current symbol and Range: All quotes to make sure the strategy works.

Create a New Strategy

Each time you want to create a new strategy to test, make a copy of the demo.afl file to use it as a starting point.

  • Copy the demo.afl file. In the video I used the name my_strategy.afl, but you can use any name you want.

Adding the Custom Columns

  • Start a command prompt and cd to the directory where you extracted the files.
  • Type the following command to add the columns to your new strategy:
python scripts\add_metrics.py --target-file my_strategy.afl

You should see output similar to the following:

E:\demo-advanced>python scripts\add_metrics.py --target-file my_strategy.afl
Added 176 columns to my_strategy.afl (backup at my_strategy.afl.bak).

The command will create a backup of your my_strategy.afl file in the event you need to revert back.

Flexible Process for Adding New Columns to Your Library

This process gives you a nice way to add more columns to your library and then automatically add the columns to any backtest you already have.

To add your own columns to your library, add them to another AFL file in this directory.

This will allow you to continue to keep them separate from the MabeKit columns, which will update over time.

Let's say you add your own additional custom columns to my_columns.afl.

You can use a prefix like MY_ for each of the columns in your file.

For example, I just created a file called my_columns.afl in the same directory with the following contents:

MY_SpecialColumn = 1;

Then you can run this command to add all the MabeKit columns and your own columns:

E:\demo-advanced>python scripts\add_metrics.py --target-file my_strategy.afl --column-file mabekit.afl --column-file my_columns.afl --also-prefix MY_
Added 177 columns to my_strategy.afl (backup at my_strategy.afl.bak).

Notice there was one more column added to the backtest. When you look at the my_strategy.afl file, you'll see it in the list:

        metric_MY_SpecialColumn = StrToNum( StrExtract( trade_metric_value, 180 ) );
        trade.AddCustomMetric( "MY_SpecialColumn", metric_MY_SpecialColumn, 2 );