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

[amibroker] Holding the last bar's value.



PureBytes Links

Trading Reference Links

Could someone help with the following which I have been trying to 
solve with AMA or HOLD without success.

Sig = 
IIf(C > ref(C,-1) AND V > Ref(V,-1),1,
IIF(C < Ref(C,-1) AND V < Ref(V,-1),2,
Ref(Sig,-1)));

Of course the last line doesn't work due to the self reference :-(

If the first condition is met I want to return "1" , and if the 
second condition is met I want to return "2". If neither condition is 
met I want to retain the previuous value (daily bars).

Keith



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/sO0ANB/LIdGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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/