Progster, Bruce,

Thank you very much for your solutions. I'll try to test both of them (and come 
back should I run into problems ;-)).

Thank you for your time - your help is highly appreciated!

--- In amibroker@yahoogroups.com, "Bruce" <bru...@...> wrote:
>
> Rise, Progster -
> I was here and was going to answer this when I saw Progster's response. 
> His is perfectly fine, but I'll go ahead and show you what I was going
> to post since is demonstrates a code pattern called function wrapping
> which minimizes the coding for a large number of variables for lazy
> people like me :,)
> This is a simple two EMA crossover system.  Set with parameters in AA
> and then Optimize.
> P.S. Its useful to recognize that what AB does is make an Optimize
> "Setup" pass (actionex=13) where is reads the variables to optimize
> based on the conditional execution of the AFL.
> function CondOptimize( Var, def, start, end, inc ){ Option   =
> ParamToggle( "Optimize - " + Var, "No,Yes", 1 );
> //  If option, optimize the designated variable if ( Option )  res    =
> Optimize( Var, def, start, end,inc ); //  Else return the default else 
> res    = def;
> return  res;}
> Shortlen  = CondOptimize( "short", 30, 10, 60, 10 );Longlen  =
> CondOptimize( "long", 100, 80, 260, 20 );
> Shortema  = EMA( C, Shortlen );Longema  = EMA( C, Longlen );
> Buy    = Cross( Shortema, Longema );Sell   = Cross( Longema, Shortema );
> Short   = Cover = 0;
> --- In amibroker@yahoogroups.com, Progster <progster@> wrote:
> >
> > Rise,
> >
> > You can use code constructs similar to this one:
> >
> > Vary_TradingMode = ParamToggle( "Vary Trading Mode ---------- ",
> > "No|Yes", 0 );
> >
> > if (Vary_TradingMode){
> > TradingMode = Optimize( "TradingMode", TradingMode_Param, 1, 3, 1) ;
> > }
> > else{
> > TradingMode = TradingMode_Default_Value ;
> > }
> >
> >
> > I write all my code this way, except for the simplest of experiments.
> >
> > - Progster
> >
> > rise_t575 wrote:
> > >
> > >
> > >
> > > Tomasz,
> > >
> > > If this indeed should be impossible, I'd like to suggest the
> following
> > > feature which shouldn't be too complicated to implement, adds a lof
> of
> > > convenience when optimizing and shouldn't have any disadvantages (i.
> > > e. I myself cannot think of any):
> > >
> > > Add an additional button (similar to the existing "Parameters"
> button)
> > > to the Automatic Analysis window, named "Optimization Parameters" or
> > > something along those lines.
> > >
> > > Here, AB could collect all optimization functions found in the
> > > backtesting code (again, similar to the "Parameters" window where
> all
> > > Param... functions are displayed).
> > >
> > > For each optimization function displayed, the user could tick the
> > > optimization "ON" or "OFF" (and change the variables of each
> > > optimization function).
> > >
> > > This would prevent the need to mess with the code each time the user
> > > wants to change the optimized variable.
> > >
> > > --- In amibroker@yahoogroups.com
> <mailto:amibroker%40yahoogroups.com>,
> > > "rise_t575" rise_t@ wrote:
> > > > Hey Herman,
> > > >
> > > > Thank you for your reply.
> > > >
> > > > I've already done that as an additonal feature (and it works), but
> I
> > > cannot change the variable being optimized itself (optimize for exit
> > > after x bars, optimize for RS Rank entry filter, etc) that way.
> > > >
> > > > The way I do it right now is writing various alternative lines of
> > > optimization code and "comment out" ("//") the ones I don't need at
> > > that time (and replacing them with a version of that code without
> the
> > > optimization part).
> > > >
> > > > But that's not a very elegant solution as I have to go through and
> > > change the code each time.
> > > >
> > > >
> > > > --- In amibroker@yahoogroups.com
> > > <mailto:amibroker%40yahoogroups.com>, Herman <psytek@> wrote:
> > > > >
> > > > > try switching the five arguments for the Optimize functions,
> i.e. use
> > > > > one Optimize( "OptName1", VarA, varB, VarC, VarD );
> > > > >
> > > > > haven't tried that but it may work if you don't change them
> during
> > > > > opts.
> > > > >
> > > > > herman
> > > > >
> > > > > > Hallo all,
> > > > >
> > > > > > Is there a way to use various optimization functions in the
> > > > > > backtest code and switch them e. g. via the ParamList
> function?
> > > > >
> > > > > > I've been trying to do this using some conditional code for
> the
> > > > > > optimization functions, but it seems that the backtester is
> using
> > > > > > every optimization function it can find within the code -
> > > regardless of any condition.
> > > > >
> > > > > > Thanks in advance.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > ------------------------------------
> > > > >
> > > > > > **** IMPORTANT PLEASE READ ****
> > > > > > This group is for the discussion between users only.
> > > > > > This is *NOT* technical support channel.
> > > > >
> > > > > > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > > > > > SUPPORT {at} amibroker.com
> > > > >
> > > > > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > > > > > http://www.amibroker.com/feedback/
> > > > > > (submissions sent via other channels won't be considered)
> > > > >
> > > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check
> DEVLOG:
> > > > > > http://www.amibroker.com/devlog/
> > > > >
> > > > > > Yahoo! Groups Links
> > > > >
> > > >
> > >
> > >
> >
>


Reply via email to