#included file is missing, was: Error 42 with program

We are working on complex formulae for Amibroker and below is the start of our formula. When I backtest it it gives an error message (which I have attached to the end of this email) pertaining to line 27 which I have highlighted. . I appreciate your thoughts.

Kind regards,

Tony Bongiorno

Part of formula with line of formula pertaining to error message highlighted:

MaxPositions = 7; //Optimize("MaxPositions", 10, 2, 20, 1);
IndexTicker = "$SPX";
Ticker = Name();

// Norgate Data
//#include_once "Formulas\Norgate Data\Norgate Data Functions.afl" 

// Backtester Options
SetOption("MaxOpenPositions", MaxPositions);
SetOption("InitialEquity", Float);
SetOption("AllowSameBarExit", True);
SetOption("AllowPositionShrinking", True);
//SetPositionSize( GetOption("InitialEquity") / MaxPositions, spsValue);
SetPositionSize( 100 / MaxPositions, spsPercentOfEquity);
//OptimizerSetEngine( "cmae" );              
if (Version() > 5.9) SetOption("WarningLevel", 1);
SetOption("InterestRate", 0);
RoundLotSize = 1;

// CBT Options
#include <TradeTracker.afl> 

When I get to the line above I get error message 42: #include file because the file does not exist: 'formula\Include\TradeTracker.afl' (current working directory is 'C:\ Program Files\Amibroker')

I appreciate any help,

Tony B

This is big contradiction.

If you work on complex formula and you don't even know that you have created file TradeTracker.afl... how is it possible that you are working on something that does not exist???

Do you understand English language? I guess so. So what is it then that you do not understand when AB clearly tells you that file does not exist? What do you not understand about the simple phrase "does not exist" ?? It is beyond me. If you work with include files then you should know that they are placed in Include folder (clearly indicated in error message).

TradeTracker.afl is not an AmiBroker file! It does not come with AB setup. It must be yours if you work on it.

If you (actually) work on it as you say then you should know where you have placed it.

And BTW have you ever heard of HDD file search via Windows Explorer?

As I said this helplessness is big contradiction to "we are working".
How can you say that you are working on something if you apparently don't do so yourself.
This rather looks like copy&paste artistry and now you wonder why 3rd party file is missing.

Hint: Go to the 3rd party guy(s) who actually created TradeTracker.afl (plus any other ones).

1 Like

It means exactly what it says: there is NO file in that place:
C:\Program Files\Amibroker\formula\Include\TradeTracker.afl

Check the folder names. And check the Preferences. Chances are that you have mistyped folder name because standard (default) folder name for formulas is not "formula" but "Formulas" (plural form).


The only "fix" is to place the file in the expected location or fix the folder/file name.

1 Like