It is possible to use staticvarset to store the parameters in memory and retrieve with staticvarget for the analysis.
eg
if(status("action")==1) staticvarset(........
if(status("action")>1) variable = staticvarget(........


The purpose is to allow the same AFL to be charted in different panes with individual parameter selections

Here is a response by TJ from some time ago on this subject

Hello,

It is NOT about speed, but about user friendliness.

You guys do NOT think about all consequences of your "ideas". I do (I really spend
long hours thinking about functionality, so each AND every bit is well-thought AND
if something works some way then it means that there is good reasoning behind it).

It makes no sense to reset parameters the way you wanted
because, if you had formula that consisted of hundreds of parameters
AND they were reset each time formula is modified it would be
HUGELY user-unfriendly - you would need then to re-adjust all parameter values
by hand. NOT an option.

if you want global parameter it is very easy to do, but NOT the way you attempted.

Instead use:

1. In the "MASTER" formula (that controls other charts) write:

value = Param( "global param", 1, 1, 20, 1 );
oldvalue = StaticVarGet( "MyGlobalParam" );
if( oldvalue != value )
{
StaticVarSet( "MyGlobalParam", value );
AB = CreateObject("Broker.Application");
AB.RefreshAll(); // refreshes other charts
}

2. In alls "SLAVE" formulas (the ones that USE global parameter) write single line:

value = StaticVarGet("MyGlobalParam");


Best regards,
Tomasz Janeczko
amibroker.com


--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 29/08/06, Dennis Brown < [EMAIL PROTECTED]> wrote:
> Thanks Graham,
>
> I can get them to agree now.
> So I have to set the parameter in my indicator, then I have to set it
> in the AA parameters, then if I want an individual equity curve, I
> have to set it again in the Equity pane?  ARGH!!!
>
> I must still be missing something --it can't be that disjointed.
> Is there a way to link them all together so changing one will change
> the others also?
> Or am I trying to use the backtester and equity in a way that was not
> intended?
>
> I am just trying to make an indicator display for one symbol show the
> equity curve and trading arrows change as a parameter slider is
> changed --just as a learning tool.
> I just want to have all the pictures agree with each other in a
> simple foolproof way.
>
> Perhaps it is done with AFL?
>
> I am trying to build up my understanding of AB and AFL one baby step
> at a time, before I do anything complicated.
>
> Your help is appreciated.
>
> Dennis
>
> On Aug 28, 2006, at 6:47 PM, Graham wrote:
>
> > You need to change the parameter values in the analysis window as well
> > for the scan
> >
> > --
> > Cheers
> > Graham
> > AB-Write >< Professional AFL Writing Service
> > Yes, I write AFL code to your requirements
> > http://e-wire.net.au/~eb_kavan/ab_write.htm
> >
> >
> > On 29/08/06, Dennis Brown <[EMAIL PROTECTED] > wrote:
> >> Hello,
> >>
> >> I am trying to get familiar with simple backtesting.  I have some
> >> simple Buy/Sell/Short/Cover rules that can be altered with a
> >> parameter.  I plot arrow objects for all four conditions so I can see
> >> what my parameter changes in realtime.  When I initially run the
> >> backtest and show trading arrows, they line up perfectly with my
> >> plotted ones.  However, when I adjust the parameter, the backtest
> >> arrows do not change even if I run another backtest.  I must be
> >> missing something fundamental about how the backtest couples with the
> >> trade rules.  I would appreciate someone setting me straight.
> >>
> >> Dennis
> >>
> >>
> >> Please note that this group is for discussion between users only.
> >>
> >> To get support from AmiBroker please send an e-mail directly to
> >> SUPPORT {at} amibroker.com
> >>
> >> For other support material please check also:
> >> http://www.amibroker.com/support.html
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.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:
>     [EMAIL PROTECTED]
>
> <*> Your use of Yahoo! Groups is subject to:
>     http://docs.yahoo.com/info/terms/
>
>
>
>


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to