[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Problem with custom backtester


  • Date: Sat, 09 Jan 2010 14:07:27 -0000
  • From: "Bruce" <brucer@xxxxxxxxx>
  • Subject: [amibroker] Re: Problem with custom backtester

PureBytes Links

Trading Reference Links

Wolfie -

I'm doing this quickly before heading off somewhere, but let me see if I can point in a direction that may help you (and hopefully one or two others).  An answer to your specific issue might depend on some details that were omitted, but let me take a SWAG.

One thing that trips some people up is that an AFL is executed multiple time in different contexts.  For example, a let's say that you do a custom backtest on SPY from 1/1/2000 - present.  It will be executed twice -

1. With the ticker SPY over the full date range of the available bars  for the ticker with a stocknum of 0 for a single ticker (or 0 thru N-1 for a watchlist).

2. With the ticker ~~~EQUITY over the From/To date range specified in the AA and a stocknum of 0 for the custom backtester pass.

So, if you have info that has been derived from the SPY pass that is outside of the info passed to the backtester (signals, prices, stops, etc.), then you have to get it to the backtester pass that is done with ~~EQUITY.  This is usually done with ATC's or static arrays.  I suspect that your variable, conzone, might be defined in some conditional logic that is not executed in the ~~~EQUITY pass.

BTW, as an aside, one of the things that I suggest in seminars that I've done on AB is to make sure that you understand all of the passes of the AFL that are done.  I usually distribute a "generic AFL" that puts out info to the debug window to highlight the different info.

-- BruceR


--- In amibroker@xxxxxxxxxxxxxxx, "wolfie125" <lurama125@xxx> wrote:
>
> Hi
> 
> I am backtesting a system with the normal backtester no problems. I want to add some position sizing details, so need to use the custom backtester. 
> 
> Currently it uses a library by calling #include_once at the start. One of the functions in that library references different timeframes and works well currently.
> 
> The moment i add 
> 
> SetOption("UseCustomBacktestProc", True );
>  
> 
> at the start of my code and obviously even with the rest of custom backtester code or without, it seems that this library function becomes a problem. 
> 
> it usually has a return value called conzone. Now the code the piece of code -> return conzone <- in the library file generates error 29 variable conzone used without having been initialized.
> 
> Any ideas of what could have caused this will REALLY be appreciated
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/