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

Re: [amibroker] Boolean question



PureBytes Links

Trading Reference Links




Graham,
Evidently, I can't see why what was once a Boolean 
is no longer a Boolean. I am trying to find a conditional variable that IF 
likes.
The whole point of this exercise is to start a 
loop within FOR after a certain number of bars have passed 
from the beginning of the data.
 
 
This works:
<FONT face=Tahoma color=#0000ff 
size=2>T1=20;Z1=True;if(Z1)for 
(i=0;i<T1;i++)     {     A1=i 
;     }
<FONT face=Tahoma color=#0000ff 
size=2>Plot(A1,"test",3,1);
 
Problem is, I need Z1 to be false 
until 20 bars have passed, and Z1 of course, gives no choice in 
this example.



This doesn't 
because of the "array error" in <FONT 
color=#ff0000>IF(Z1) , although there is only one 
possible response per bar, and <FONT 
color=#ff0000>Z1 sure looks Boolean to me since it is either 
true or false.
T1=20;Z1=BarIndex() > 
T1;if(Z1)for (i=0;i<T1;i++)     
{     A1=i ;     
}
<FONT 
color=#ff0000>Plot(A1,"test",3,1);


Z1 = ( (BarIndex() > T1) == true 
);  doesn't work, and of course <FONT 
color=#ff0000>Z1=IIF(BarIndex() > T1,TRUE,FALSE); 
doesn't work.
 
 
Possibly, I should write the loop as a function and 
access the function after the necessary number of bars have passed 
by:
 
Plot( IIF( Z1, 
function(loop), NULL ), "test", 
Color, Line);
 
Any other ideas?
 
Thanks,
-CS

<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=gkavanagh@xxxxxxxxxxxxx 
  href="">Graham 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Monday, May 26, 2003 6:15 AM
  Subject: RE: [amibroker] Boolean 
  question
  
  
  <SPAN 
  >Z1 will be a 0 or 1 depending if 
  the condition is false or true
  <SPAN 
  > 
  
  <FONT face="Times New Roman" color=teal 
  size=3><SPAN 
  >Cheers,<FONT 
  color=teal size=3><SPAN 
  >Graham
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/ASXShareTrading
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/FMSAustralia
  <SPAN 
  >-----Original 
  Message-----From: CS 
  [mailto:res1wgwl@xxxxxxxxxxx] <SPAN 
  >Sent: <FONT 
  face=Tahoma>Monday, 26 May 
  2003 
  7:41 
  PM<SPAN 
  ><SPAN 
  >To: <A 
  href="">amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: [amibroker] Boolean 
  question
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >In AFL:
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face=Tahoma 
  size=2><SPAN 
  >T1=20;
  
  <FONT face=Tahoma 
  size=2><SPAN 
  >Z1=BarIndex()>T1;
  
  <SPAN 
  >Does <FONT 
  face=Tahoma>Z1 
  contain a boolean response?
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >Anyone know how to convert 
  <SPAN 
  >Z1 to 
  boolean?
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >Thanks,
  
  <SPAN 
  >-CS
  <FONT face="Times New Roman" 
  size=2><SPAN 
  ><FONT 
  face="Courier New">Send BUG REPORTS to bugs@xxxxxxxxxxxxx<FONT 
  face="Courier New"><FONT 
  face="Courier New">Send SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx<FONT 
  face="Courier New">-----------------------------------------<FONT 
  face="Courier New">Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
  face="Courier New">--------------------------------------------<FONT 
  face="Courier New">Check group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to 
  the Yahoo! Terms of 
  Service. 
  Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.