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

[amibroker] Re: IIF statement



PureBytes Links

Trading Reference Links










You could always try using LastValue

 

LastBar       = <font
size=3 face=Arial>LastValue<font
face=Arial> (ValueWhen(TimeNum()>EndTime-10000
and TimeNum() <= EndTime,BarIndex(),1));

 

 



Cheers,
Graham
http://e-wire.net.au/~eb_kavan/ 



<span
>-----Original Message-----
From: Ara Kaloustian
[mailto:ara1@xxxxxxxxxx] 
Sent: Wednesday, August 04, 2004
4:04 PM
To: AB-Main
Subject: [amibroker] AFL

<font size=2
face="Times New Roman"> 



<span
>I am trying to build a module to
compute the support resistance lines for RT application





<font size=2
face="Times New Roman"> 





<span
>The line below deternines the last
closing bar.





<font size=2
face="Times New Roman"> 





<span
>The code works correctly except when
I have clicked on the chart and therefore selected a bar other than the last
bar. The result I get is with reference to the selected bar ... not the last
bar that I want.





<font size=2
face="Times New Roman"> 





<span
>How could I change this so that the
last bar is always referenced - to guarantee that operator interference (like
clicking on chart) does not affect results?





<font size=2
face="Times New Roman"> 





<span
>Thanks





<font size=2
face="Times New Roman"> 





<span
>Ara





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman"> 





<span
>EndTime = 131500;





<span
>LastBar      
= ValueWhen(TimeNum()>EndTime-10000 and TimeNum() <=
EndTime,BarIndex(),1);





<font size=2
face="Times New Roman"> 



<font size=2
face="Times New Roman">

Check AmiBroker web page at:<font
face="Courier New">
http://www.amibroker.com/

Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html










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

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








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.