SetCustomBacktestProc doesn't behave as indicated in AFL Function Reference

Hi Tomasz,

According to the online AFL Function Reference at

The SetCustomBacktestProc should work like this:
SetCustomBacktestProc( "Formulas\", True );

However, this causes two errors.

  1. You have to use double backslashes or you will get error 54.
  2. You have to include the entire file path, including the drive, or the backtester won't find the file.


The way to make it work with a filename is to include the entire filepath using double-backslashes:
SetCustomBacktestProc( "C:\Program Files\AmiBroker\Formulas\Backtests\CBT", True );

This is how it works in my version of AB which is 6.30.

Is the Function Reference out of date? Or is this unexpected behavior of the function?

Peter Deal

@PeterD if you follow the link provided in the AFL Function Reference (that you have quoted above)


... you can answer these questions yourself:


BTW because you have not used code tags/code button, your double backshlashes turned into single backshlashes. This is another example showing, that using code tags/code button on the forum is mandatory:

Without code tags:

SetCustomBacktestProc( "C:\Program Files\AmiBroker\Formulas\Backtests\CBT", True );

With code tags:

SetCustomBacktestProc( "C:\\Program Files\\AmiBroker\\Formulas\\Backtests\\CBT", True );



Thanks, Milosz. I'm new to the forum so I appreciate your guidance on using the tags.

But here's the trouble with the Function Reference:

It seems to me that this example should be updated to use the double slashes.

“One who makes no mistakes makes nothing”

Giacomo Casanova :wink:

By the way, if someone was wondering how does forward slash and backslash look like, here it is :grin:



@Milosz , that forward/back "Slash" is pretty good! :sunglasses:

1 Like