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

Re: [amibroker] Re: Is it possible to force parameter changes programatically?



PureBytes Links

Trading Reference Links

Hi,

I had a similar problem. Afaik, currently there is no way of forcing 
parameter reset. Parameters, with their range, and values are cached.
So if you change a parameter like you did, it will not work. Default values 
are cached as well.

My solution is a bit different:

I store required parameter values in parameter files for each security. 
These are dafault values that should be used for backtest and live trading. 
I have a module that reads these values to variables.

I have parameter statements for all parameters. But the default values are 
OUT OF VALUE RANGE. E.g. period parameter should be in range 5 to 25. The 
default value is -1 in the parameter statement.
PeriodParam = Param(LabelPeriodParam, -1, 5, 25, 5);

Then a check the value of the param statement. If it is out of range, I use 
the value from the file. If it is manually set, I use that value.
If I change security, the values from security file are used (unless manual 
setting were done).

So it look like this:

//Determining market hours (entry) and exit time
MarketOpenTimeData = ReadParamValueFile("MarketOpenTime");
MarketOpenTimeParam = ParamTime("*Market open time", "0:00:00",0);
if (MarketOpenTimeParam == 0)
    MarketOpenTimeParam = MarketOpenTimeData;

If I hit Reset in param window, default parameter values are set which means 
using values from parameter file for the security.

Regards,

Y

--------------------------------------------------
From: "japple_55" <aimria@xxxxxxxxx>
Sent: Tuesday, May 26, 2009 2:24 PM
To: <amibroker@xxxxxxxxxxxxxxx>
Subject: [amibroker] Re: Is it possible to force parameter changes 
programatically?

> MurthySuresh,
> Thanks for your idea but...I used the following code (I'm not a programmer 
> but think it is correct). The printf statements indicate the cases are 
> switching properly but the parameter settings still do not change when I 
> change the chart being viewed until I force a "reset all" from the 
> parameters window. Any ideas on how to force this reset?
> *************************
> switch (Name())
> {
>    case "AHTFX":
>      TrailB = Param( "Entry %", 2, 1, 20, 1 )/100;
> TrailS = Param( "Exit %", 2, 1, 20, 1 )/100;
> printf("Parameter changed to 2\n");
>      break;
>    case "PTTDX":
> TrailB = Param( "Entry %", 3, 1, 20, 1 )/100;
> TrailS = Param( "Exit %", 3, 1, 20, 1 )/100;
> printf("Parameter changed to 3\n");
> break;
>    default:
>     TrailB = Param( "Entry %", 6, 1, 20, 1 )/100;
> TrailS = Param( "Exit %", 6, 1, 20, 1 )/100;
>  printf("Parameter changed to Default 6\n");
>    break;
> }
> ***********************************
>
>
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@xxx> wrote:
>>
>> you cannot use the param in conditional statements. like
>> ParamStr etc
>> what i meant was that you can store the param values in a variable 
>> param1, param2....
>> and use the switch statements to chagne the param values in that 
>> variable.
>>
>>
>>
>>
>> --- In amibroker@xxxxxxxxxxxxxxx, "japple_55" <aimria@> wrote:
>> >
>> > Did that already but the parameters do not actually change when I 
>> > change the symbol in the chart. The Reset button in the parameters 
>> > window has to be used to force the change.
>> >
>> >
>> >
>> > --- In amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@> wrote:
>> > >
>> > > i dont think so. why dont you just use conditional statements.
>> > > with if(name()=="blah")
>> > > {
>> > > param1=something
>> > > }
>> > >
>> > > or you can use a switch case.
>> > >
>> > > --- In amibroker@xxxxxxxxxxxxxxx, "japple_55" <aimria@> wrote:
>> > > >
>> > > > I have a single system plotted on a chart that I would like to 
>> > > > view/test for several symbols, where only the parameters will 
>> > > > change according to the symbol being viewed/tested.
>> > > >
>> > > > I've got the parameter changes coded as symbol dependent ("IIF name 
>> > > > = ...") and their values reflect properly in the title when I 
>> > > > change symbols. But, the system calculations don't update with the 
>> > > > new parameters unless I manually reset from the parameters window. 
>> > > > Is there a way to force this reset programatically within the AFL 
>> > > > code so the changes happen automatically when I change symbols?
>> > > > Thanks,
>> > > > Jim
>> > > >
>> > >
>> >
>>
>
>
>
>
> ------------------------------------
>
> **** 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
>
>
>
> 


------------------------------------

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/