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

Re: [amibroker] How to initialise variable?



PureBytes Links

Trading Reference Links

Hi,

The formula you wrote
value = IIF(H>C, Ref(value, -1), 1);

is self-referencing (MS uses PREV for this). 
This does not work in pure AFL.
You should either use AFL scripting for this
or rewrite formula to use functions like Cum(), ValueWhen().
In most cases it is possible to write your formula
without self-referencing statements.
BTW: Your example formula returns "1" always.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: "Marek Chlopek" <marek.chlopek@xxxx>
To: "Amibroker ML" <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, October 07, 2001 5:10 PM
Subject: [amibroker] How to initialise variable?


> Hello Amibroker users,
> Could you please advise me how to assign initial value to new variable in
> AFL?
> 
> I have situation like that (this is only example to simplify):
> value = IIF(H>C, Ref(value, -1), 1);
> 
> and AFL Error window shows message
> "value = IIF(H>C, Ref(value,
> ^
> 
> Unknown identifier"
> 
> Thanks,
> Marek Chlopek
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>