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

[amibroker] iif and ref



PureBytes Links

Trading Reference Links

I’m trying to write a very simple indicator that references itself.

 

Like:

 

ab = C - 100;

 

ab =   IIf(C < Ref(ab,-1), C + 100,

             IIf(C > Ref(ab,-1), C,

             C - 100));

 

Plot(C,"Close",colorBlue);

Plot(ab,"ab",colorRed);

 

 

In my first attempts I didn’t use the first assignment of zz and got an error:

Variable 'zz' used without having been initialized.

 

Now, no errormessages appear, but only the close will be plotted.

 

Can anyone help?

 

 

Arie



Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html




Yahoo! Groups Links