I have an include file which contains some variables for use in my 
backtest, eg:

<INCLUDE FILE>
myvar = 1;
</INCLUDE FILE>

My backtest AFL is as follows:

#include <INCLUDE FILE.afl>;
(rest of file....)

This works fine and the backtest AFL uses myvar correctly when NOT 
using the custom backtester.

However, if I add the Custom Backtester code - below - I get the 
following error:

"Variable 'myvar' used without being initialized"

It seems the Custom Backtester ignores include files.

What can I do here as I am stuck?

---------------------------------

SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
        bo = GetBacktesterObject();

        bo.PreProcess();

        for( trade = bo.GetFirstTrade(); trade; trade = 
bo.GetNextTrade() ) 
        { 
                if (trade.Shares > 10)
                { trade.Shares = 20; } 
        }
}

Reply via email to