Amibroker - AddColumn and Immediate If (IIF) - Aussie Stock Forums

1. ## Amibroker - AddColumn and Immediate If (IIF)

Hi All,

Need help from Amibroker expert here. In my analysis scanner, I need to add column under the following conditions.
1. 0-1% up from previous day - assign a 1
2. 1-2% up from previous day - assign a 2
3. >2% up from previous day - assign a 3
The next 3 conditions are for down, just -1, -2, and -3.

I am having trouble with this statement AddColumn(IIF(........),1.4). I am using a nested IFF for the 6 conditions. Is this possible ? Thanks in advance.

2. ## Re: Amibroker - AddColumn and Immediate If (IIF)

Hi Peter --

See if this helps.

//
DailyChange = 100 * ( C - Ref( C, -1 ) ) / Ref( C, -1 );
DCInt = IIf( DailyChange > 0, int( DailyChange ) + 1, int( DailyChange ) - 1 );

Plot( DailyChange, "DC", colorGreen, styleLine );
Plot( DCInt, "DCInt", colorRed, styleLine );

Filter = 1;

////////////////// end ///////////////////////

Thanks,
Howard

3. ## Re: Amibroker - AddColumn and Immediate If (IIF)

Hi Howard,
Thank you very much for the suggested solution. It works.
The outout list is very long. Is it possible to add a condition to show only e.g. changes more than > +/- 0.5% ?

Thanks again. Peter

4. ## Re: Amibroker - AddColumn and Immediate If (IIF)

Hi Peter --

One way to restrict the output is through use of the Filter statement.

For example something like this:

Filter = abs(DailyChange) >= 0.5;

Thanks,
Howard

5. ## Re: Amibroker - AddColumn and Immediate If (IIF)

Hi Howard,

To an expert like you, it's so effortless.
Once again, thank you very much.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Aussie Stock Forums