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

Re: [amibroker] Auto Optimize



PureBytes Links

Trading Reference Links

Try this Glenn, load entire code into Indicator builder.

// optimization loop

//Run in Explore mode

//set range dates

bestequity = 0;

bestrange = 0;

// optimization loop

for( period = 10; period < 40; period ++ )

{

Buy = Cross( Close, EMA( Close, period ) );

Sell = Cross( EMA( Close, period ), Close );

Short=Sell;

Cover=Buy;

Le = LastValue( Equity() );

if( Le > bestequity )

{

bestequity = Le;

bestrange = period ;

}

}

period = bestrange;

Buy = Cross( Close, EMA( Close,period ) );

Sell = Cross( EMA( Close, period ), Close );

Short=Sell;

Cover=Buy;

Filter = BarIndex() == BarCount - 1;

AddColumn( bestrange, "period " );

AddColumn( Equity(), "Best Equity" );

// Indicator builder Output

Plot(EMA( Close,period ),"",colorYellow,styleLine);

Plot(C,"",colorBlack,styleCandle);

Title=Name()+" Best Period ("+WriteVal(Period,1)+")";



Anthony

----- Original Message ----- 
From: "Glenn" <glennokb@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, November 24, 2003 4:04 PM
Subject: [amibroker] Auto Optimize


> Hello there,
>
> Is it possible to automatically optimize a couple of variables over a
> lookback period in the indicator builder. If so, how would you do this
> please?
>
> Glenn
>
>
>
> 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/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003


------------------------ 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/mOAaAA/3exGAA/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/