PureBytes Links
Trading Reference Links
|
-----Original Message-----
From: nurudinkaba [mailto:n.kaba@xxxxxxxxxx]
Sent: Thursday, September 04, 2003 10:27 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Optimizing & Robustness of single parameters
unfortunatly, nothing was attached...again.
Here is the code, watch for line-wraps!!!
Herman.
Buy=Sell=Short=Cover=0;
function System( TestParameter )
{
// Steve Karnish' CMO5 system (Basic)
Threshold1 = 100-TestParameter;
Threshold2 = TestParameter;
Ind=scCMO(C,5);
Buy=Cross(Threshold1 ,Ind);
Sell=Cross(Ind,Threshold2 );
Short=Sell;
Cover=Buy;
E=Equity();
return E;
}
BestTestParameter = 0;
InitialEquity= 100;
SetOption("InitialEquity",InitialEquity);
TestParameter = 50;
E = System( TestParameter );
Plot(E,"Default Equity",colorWhite,styleLine|styleThick);
EMAx = 0;
for( TestParameter =0; TestParameter <100; TestParameter =TestParameter
+1 )
{
E = System( TestParameter );
if ( LastValue(E) > EMAx )
{
EMAx = LastValue(E);
BestTestParameter = TestParameter ;
}
Co = IIf(E<InitialEquity,colorRed,colorBlack);
Plot(E,"Test Equity",Co,styleLine|styleNoLabel);
}
E = System( BestTestParameter );
Plot(E,"Best Equity",colorBrightGreen,styleLine|styleThick|styleArea);
Title = "Best Threshold= "+WriteVal(BestTestParameter ,1.0)+" gives
"+EncodeColor(colorGreen)+" Best Equity = "+WriteVal(E,1.0)+
EncodeColor(colorBlack)+" LastYear's Profit=" +
WriteVal(ROC(E,260),1.0)+"%";
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|