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

[amibroker] Re: Optimize function



PureBytes Links

Trading Reference Links

Bill,
Optimization, by itself, has no restriction property.
When we say Optimize, the AA will check the settings or whatever 
overwrites the settings.
In my example, the settings are "all quotations".
But, the trading rules are restricted by definition:
Buy=d2002*Cross(StochD(),k);
Sell=d2002*Cross(StochD(),70) ;
This d2002 is a binary quantity, equal to 1 or 0, as definrd in the 
previous lines. The d2002*something will give something or 0.
Consequently, when d2002 is true, the AA will read
Buy=Cross(StochD(),k);
Sell=Cross(StochD(),70);
and when d2002 is false, the AA will read
buy=0;
sell=0;
Make a scan for all quotations to see. The trades will be for 2002 
dates only.
In other words, in order to optimize from datenum1 to datenum2, just 
define trades for this period only and thatīs it !!

--- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <wd78@xxxx> wrote:
> 
> ----- Original Message ----- 
> From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Friday, September 12, 2003 12:48 PM
> Subject: [amibroker] Re: Optimize function
> 
> 
> > Bill,
> > I have posted in the past the walk-forward optimization.
> > Here is the basic principle, for a restricted period optimization
> > [year2002 in the example]
> 
> If I correctly understand, optimization of k is still being 
established on
> the entire dataset, rather than only on 2002 data.  Right?  If so, 
how would
> you restrict Optimize to operate only in 2002?
> 
> > of a Stochastic o/b, o/s system :
> >
> > k=Optimize("k",40,30,50,10);
> > d2002=DateNum()>=1020101 AND DateNum()<1030101;
> > LastTradingBar=(d2002==0 AND Ref(d2002,-1))*DateNum();
> > Buy=d2002*Cross(StochD(),k);
> > Sell=d2002*Cross(StochD(),70) OR DateNum()==LastTradingBar;
> >
> > Hit now Optimize for
> > *current stock
> > *all quotations
> > AA will see only 2002 dates.
> > It is important to exit any open trade by the end of the test 
period,
> > else the last probable Open trade will last for ever !!
> > The solution is that{  OR DateNum()==LastTradingBar } statement.
> > Dimitris Tsokakis
> > --- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <wd78@xxxx> 
wrote:
> > >
> > > ----- Original Message ----- 
> > > From: "Stephane Carrasset" <nenapacwanfr@xxxx>
> > > To: <amibroker@xxxxxxxxxxxxxxx>
> > > Sent: Friday, September 12, 2003 11:55 AM
> > > Subject: [amibroker] Re: Optimize function
> > >
> > >
> > > > Bill,
> > > >
> > > > do you mean if you Backtest for example NDX on the last 500 
bars
> > > > do you want optimize an indicator on the 500-400 bars?? then 
keep
> > the
> > > > optimized value on the 400-1 bars ??
> > >
> > > I was not thinking of that, but your scenario is along the same
> > lines and
> > > would be a another important option.  I was actually thinking of
> > the problem
> > > from 180 degrees around.  Specifically, for a dataset of, for
> > example, 1000
> > > bars optimize only over the last 500 and display the equity 
curve
> > for that
> > > range.  It is possible to only consider (and display) the equity
> > for a
> > > specified number of bars (e.g., the last 500 bars), but I don't 
see
> > how to
> > > restrict optimization to those bars.  Certainly not with the
> > available
> > > arguments for Optimize.
> > >
> > > >
> > > > Stephane
> > > >
> > > > > It is my understanding that the Optimize function operates 
on
> > all
> > > > data.  So,
> > > > > for example, if one is looking at equity for a portion of 
the
> > data
> > > > (e.g.,
> > > > > Equity(0, 1, 100) Optimize still operates on all data.  Does
> > anyone
> > > > have a
> > > > > work-around that will force Optimize to only consider a
> > specified
> > > > range of
> > > > > data?
> > > > >
> > > > > Thanks.
> > > > >
> > > > > Bill
> > > >
> > > >
> > > >
> > > > Send BUG REPORTS to bugs@xxxx
> > > > Send SUGGESTIONS to suggest@xxxx
> > > > -----------------------------------------
> > > > 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/
> > > >
> > > >
> >
> >
> >
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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/
> >
> >


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