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

Re: [Amibroker] Creating a toggle switch



PureBytes Links

Trading Reference Links

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





YAHOO! GROUPS LINKS