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

Re: [amibroker] What's wrong with my formula (trouble with custombacktest)



PureBytes Links

Trading Reference Links

Hi,

Ok let me try to explain again.

I have a file with

run = Optimize ("run", 1,1,1000,1);

SetOption("UseCustomBacktestProc", True );
SetCustomBacktestProc( "C:\\Program Files\\Amibroker1\\Formulas\\Custom\\custom_backtest.afl" );

SetOption("MaxOpenPositions", 5 );
SetOption("InitialEquity", 100000 );
SetOption("AllowPositionShrinking", True );
SetOption ("AllowSameBarExit", False);
SetOption ("ActivateStopsImmediately", False);
SetOption ("MinShares", 100);
SetOption ("MinPosValue", 5000);
SetOption ("PriceBoundChecking", True);
SetOption ("CommissionMode", 2);
SetOption ("CommissionAmount", 25);
SetOption ("AccountMargin", 100);
SetOption ("ReverseSignalForcesExit", True);
SetOption ("UsePrevBarEquityForPosSizing", True);
SetOption ("PortfolioReportMode",0 );
 

ShortTrades = ParamToggle("Short Trades?","Oui|Non",1);
Longtrades = ParamToggle("Long Trades?","Oui|Non",1);

PositionScore = Random();

buy=....;
sell=.....;
short=.... etc.


Then, in c:\\Program Files\\Amibroker1\\Formulas\\Custom\\custom_backtest.afl I have another file with


SetOption("MaxOpenPositions", 5 );
SetOption("InitialEquity", 100000 );
SetOption("AllowPositionShrinking", True );
SetOption ("AllowSameBarExit", False);
SetOption ("ActivateStopsImmediately", False);
SetOption ("MinShares", 100);
SetOption ("MinPosValue", 5000);
SetOption ("PriceBoundChecking", True);
SetOption ("CommissionMode", 2);
SetOption ("CommissionAmount", 25);
SetOption ("AccountMargin", 100);
SetOption ("ReverseSignalForcesExit", True);
SetOption ("UsePrevBarEquityForPosSizing", True);
SetOption ("PortfolioReportMode",0 );


and when I click "backtest" nothing happens if

SetOption("UseCustomBacktestProc", True );

but it works well if

SetOption("UseCustomBacktestProc", False);

but of course I'd prefer to use the custom backtest.

Also,  if I click the "use custom backtest" in the AB interface and choose the first file or the second, still nothing happens if custombacktestproc is true.  It has to be false for results to show.

Can you help?

Thanks,

Louis




2008/3/21, Graham <kavemanperth@xxxxxxxxx>:

I do not understand what you mean by parameters. The custom file is for the advanced backtest coding that is read after the portfolio backtest run is complete to either change the backtest or report special custom metrics.
If all you want is input information for the afl, then use #include


--
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com

On 21/03/2008, Louis Préfontaine <rockprog80@xxxxxxxxx> wrote:
Hi Graham,

Yes I have the file setted as you said, but what exactly should I put in that file?  If I put only the parameters and no rule, is it ok?

Ton: I am not sure what is AA or ABS...

Louis

2008/3/19, Ton Sieverding <ton.sieverding@xxxxxxxxxx>:

Louis, why are you using all these SetOptions when AA has the ABS facility ? Create an ABS, load the ABS in your AFL with LoadSettings method and you've got what you want. What's wrong with that ?
 
Regards, Ton.
 
----- Original Message -----
Sent: Wednesday, March 19, 2008 3:54 AM
Subject: Re: [amibroker] What's wrong with my formula (trouble with custombacktest)

Hi,

I don't have 4.90, so setbacktestmode does not work...

I edited a new file with this inside:

run = Optimize ("run", 1,1,1000,1);

SetOption("UseCustomBacktestProc", True );

SetOption("MaxOpenPositions", 5 );
SetOption("InitialEquity", 100000 );
SetOption("AllowPositionShrinking", True );
SetOption ("AllowSameBarExit", False);
SetOption ("ActivateStopsImmediately", False);
SetOption ("MinShares", 100);
SetOption ("MinPosValue", 5000);
SetOption ("PriceBoundChecking", True);
SetOption ("CommissionMode", 2);
SetOption ("CommissionAmount", 25);
SetOption ("AccountMargin", 100);
SetOption ("ReverseSignalForcesExit", True);
SetOption ("UsePrevBarEquityForPosSizing", True);
SetOption ("PortfolioReportMode",0 );
 

ShortTrades = ParamToggle("Short Trades?","Oui|Non",1);
Longtrades = ParamToggle("Long Trades?","Oui|Non",1);

PositionScore = Random();

and saved it as custom_backtest.afl at the right place.  Then  I added this at the beginning of the file with my formula:

SetOption("UseCustomBacktestProc", True );
SetCustomBacktestProc( "C:\\Program Files\\Amibroker\\Formulas\\Custom\\custom_backtest.afl" );


I don't understand why it is not working...

Louis


2008/3/18, Graham <kavemanperth@xxxxxxxxx>:

If you set custombacktestproc as true , you must have a custom backtest code to read.

you could try the function SetBacktestMode


--
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com 


On 19/03/2008, Louis Préfontaine <rockprog80@xxxxxxxxx> wrote:
Hi,

My formula starts like this:

run = Optimize ("run", 1,1,1000,1);

SetOption("UseCustomBacktestProc", True );

SetOption("MaxOpenPositions", 5 );
SetOption("InitialEquity", 100000 );
SetOption("AllowPositionShrinking", True );
SetOption ("AllowSameBarExit", False);
SetOption ("ActivateStopsImmediately", False);
SetOption ("MinShares", 100);
SetOption ("MinPosValue", 5000);
SetOption ("PriceBoundChecking", True);
SetOption ("CommissionMode", 2);
SetOption ("CommissionAmount", 25);
SetOption ("AccountMargin", 100);
SetOption ("ReverseSignalForcesExit", True);
SetOption ("UsePrevBarEquityForPosSizing", True);
SetOption ("PortfolioReportMode",0 );
 

ShortTrades = ParamToggle("Short Trades?","Oui|Non",1);
Longtrades = ParamToggle("Long Trades?","Oui|Non",1);

PositionScore = Random();

buy=.................................
sell=.....
etc.

Is there something wrong with this, as when I click "backtest" I see no results.  When I change the custombacktestproc for "false" everything works well, but how do I do to get it my own way?  Cause I'd like to be able to be in more than one trade at a time.   And also, I think been in more than one trade at a time could make my Monte Carlo backtesting more reliable (am I right?).

Thanks,

Louis









__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___