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

Re: [amibroker] Valuewhen



PureBytes Links

Trading Reference Links

Hello,

No, your second line simply overwrites previous line.
AFL executes from top to bottom just once (http://www.amibroker.com/newsletter/09-2001.html)

I don't know what you are trying to achieve but you should be using
IIF rather.

sig = ValueWhen( x OR y, IIF( x, H, L ) ); // keep H if x happened, or keep L if y happened

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: <kk2628@xxxxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, February 07, 2003 12:38 PM
Subject: [amibroker] Valuewhen


> Hi,
> 
> Following is the code which I hv problem :
> 
> sig=valuewhen(x,H,1); //(when x is true, sig has the value of H)
> 
> (some other codes)
> 
> sig=valuewhen(y,L,1); // when y is true, sig has the value of L
> 
> My problem is the sig value still remain as H in the next bar even x 
> is false and y is true in the previous bar which sig has been 
> assigned the value L ??? Isn't sig should be L ?
> 
> TIA
> kk
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> 
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

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

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/