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

RE: [amibroker] parameter dependent on date



PureBytes Links

Trading Reference Links

Looks great,but …. I can‘t use EMA(cena,period1), because that argument is incorect type(function expects different argument here), so only way how to solve this is to use loop(see attached file-I know, it looks complicated,but in fact there ar only few arrays from which I then took values for different interval of times)… BUT this doesn’t work eitherL And I do not know whyL Please help L

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of ChrisB
Sent: Saturday, January 19, 2008 3:35 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] parameter dependent on date

 

aleskresta

You could look up the Datenum() function in the help files for your dates.
Then you use the array based IIF function.

Something like this to get you started:

******
y1 = DateNum() > 1000101 AND DateNum() < 1010101;
y2 = DateNum() > 1010101 AND DateNum() < 1020101;
y3 = DateNum() > 1020101 AND DateNum() < 1030101;

period1 =IIf(y1,1, IIf(y2, 5, IIf(y3,2, Null)));
period2 = IIf(y1,2, IIf(y2, 10, IIf(y3,4,Null)));

Filter = DateNum() > 1000101;

AddColumn( DateNum(),"datenum");
AddColumn(period1, " p1");
AddColumn(period2," p2");
*******
Run the exploration to help you see if the results are as you expected.

Regards
ChrisB

aleskresta wrote:
>
> Hi there,
>
> I need some help please:( I have got, let's say this simple system:
>
> period1 = Optimize( "Perioda 1", 3, 1, 30, 1 );
> period2 = Optimize( "Perioda 2", 5, 1, 120, 2 );
>
> cena = ParamField(" Cena", field = 3 );
>
> Buy = Cross(EMA(cena, period1), EMA(cena, period2)) ;
> Sell = Cross(EMA(cena, period2), EMA(cena, period1)) ;
>
> but now, lets say I want to have the variables to have its value
> dependet on date. Lets say that
>
> for bars between 1.1.2000 and 1.1.2001 it will be
> period1 = 1;
> period2 = 2;
> for bars between 1.1.2001 and 1.1.2002 it will be
> period1 = 5;
> period2 = 10;
> for bars between 1.1.2002 and 1.1.2003 it will be
> period1 = 2;
> period2 = 4;
>
> How can I write it, so I can run AA from 1.1.2000 till 1.1.2003.
> Please help, i read the help file, but did not find any answer:( Tha
> nks a lot :)
>
>

__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Attachment: Description: Binary data