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

RE: [amibroker] Re: What's wrong with this backtest?



PureBytes Links

Trading Reference Links

I think  you need to push the stop sell to be one day minimum after the buy
Either use 0 or 2 rather than 1

ExitAtStop = 0 - means check stops using only trade price and exit at
regular trade price (if you are trading on close it means that only close
price will be checked for exits and exit will be done at close price)
ExitAtStop = 2 - check High-Low prices but exit NEXT BAR on regular trade
price.

ApplyStop(stopTypeTrailing, stopModePoint, 3*ATR(21), 0,1);

Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: bruiserbbq [mailto:bruiserbbq@xxxxxxxxxxxx] 
Sent: Thursday, July 01, 2004 9:38 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: What's wrong with this backtest?

Thanks for your help again Al...but I'm still getting the buy and 
sell on the same day and only the one day...even though its tested 
over 1000 days:See example below...trade starts and ends on same day.

Ticker	Trade	        Date	       Price	Ex. date    Ex. Price
	
CTX	Long (n-bar)	23/11/2001	1.3	23/11/2001  1.3	
	
Here's the code so far

cond1 = ADX(14) > 20;
cond2 = High > Ref(HHV(H,30),-1);
cond3 = Volume > 200000;
cond4 = Close > 0.15;

Filter = cond1 AND cond2 AND Cond3 AND Cond4;

Buy = cond1 AND cond2 AND Cond3 AND Cond4;

Sell = 0; //use the ApplyStop function exclusively as your exit
ApplyStop(stopTypeTrailing, stopModePoint, 3*ATR(21), 1,1);



PlotShapes( shapeUpArrow * Buy, colorGreen );
PlotShapes( shapeDownArrow * Sell, colorRed );

AddColumn(Buy,"Buy");
AddColumn(Sell,"Sell");

AddColumn(Open,"Open",1.3);
AddColumn(Close,"Close",1.3);
AddColumn( ADX(14), "ADX", 1.2 );
AddColumn(Volume,"Volume",1.0);


Cheers  Bruiser




Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/