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

Re: [Amibroker] Creating a toggle switch



PureBytes Links

Trading Reference Links

I was only addressing your comment about IIF not working in loops.  I've not seen that problem.  Can you post an example?
----- Original Message -----
From: Terry
Sent: Monday, June 27, 2005 11:31 AM
Subject: RE: [Amibroker] Creating a toggle switch

Tomasz will have to explain the circumstances in which this works or not.

I just know I have gotten errors trying to use the array IIF inside a loop, which doesn’t even make sense since which part of the array would you be referencing when looping through bar by bar?

 

Did you try my version? Does it work?

--

Terry

-----Original Message-----
From:
amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of wavemechanic
Sent: Monday, June 27, 2005 09:05
To:
amibroker@xxxxxxxxxxxxxxx
Subject: Re: [Amibroker] Creating a toggle switch

 

 

----- Original Message -----

From: Terry

Sent: Monday, June 27, 2005 9:24 AM

Subject: RE: [Amibroker] Creating a toggle switch

 

You can't use IIF inside a loop. I'm surprised you aren't getting
compiler errors.

 

I must not be following something here.  Look at the following loop from the Users Manual modified with an IIF which works OK.  What am I missing?

 

Len = Param("Len", 20, 10, 50, 10);

factor = 2 / (Len + 1);

e1 = e2 = Close[0];

for(i = 0; i < BarCount; i++)

{

e1 = factor * Close[ i ] + ( 1 - factor ) * e1;

e2 = factor * e1 + (1 - factor) * e2;

myDemaIIF[i] = IIf(len == 20, 2 * e1 - e2, 0);

}

Plot(myDemaIIF, "Dema in iif loop", colorRed);

Plot(DEMA(C, Len), "Built-in DEMA", colorWhite);



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






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




No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.5/32 - Release Date: 6/27/05


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