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

Re: [amibroker] Null constant



PureBytes Links

Trading Reference Links




Jerome,
 
You don't need to go through the complexity of a 
FOR loop.
 
test=<FONT 
color=#ff0000>IIf(<FONT 
size=2>IsNull(mo),1<FONT 
size=2>,0<FONT 
size=2>);
Plot<FONT 
color=#ff0000>(test,"Null=1"<FONT 
size=2>,colorblue,1<FONT 
size=2>);
 
There are several functions for testing presence 
of valid data:
IsNull
IsEmpty
IsFinite
Nz
IsNaN
IsTrue...
 
-Corey Saxe
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Jérôme ULRICH 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Friday, November 28, 2003 7:16 
  AM
  Subject: [amibroker] Null constant
  
  <FONT face=Arial 
  size=2>Hello,
  <FONT face=Arial 
  size=2> 
  Until yet, I have 
  not succeeded in using the "Null" constant in for loops. In the simple 
  following code, I would have expected the first 5 bars of the "test" 
  array to hold a "1" value. This is not the case, so the expression (mo[i] == 
  Null) does not return a true result even when the MA(C,5) doesn't return any 
  value. Is this by design or do I use this constant in a wrong way 
  ?
  <FONT face=Arial 
  size=2> 
  Thank you in 
  advance for any piece of help.
  <FONT face=Arial 
  size=2> 
  Best regards, 
  Jérôme ULRICH
  <FONT face=Arial 
  size=2> 
  <FONT face=Arial 
  size=2> 
  <FONT 
  size=1><FONT 
  size=2>-------------------------
  
  mo = MA(C,<FONT 
  face="Courier New" color=#ff00ff>5);<FONT 
face="Courier New">
  test = <FONT face="Courier New" 
  color=#ff00ff>0;<FONT 
  face="Courier New" color=#800000>
  for<FONT 
  face="Courier New">(i=<FONT face="Courier New" 
  color=#ff00ff>0<FONT 
  size=3>;i<BarCount;i++)
  {
  <FONT 
  size=3>if(mo[i] == 
  Null) test[i] = <FONT face="Courier New" 
  color=#ff00ff>1<FONT 
size=3>;
  }
  AddColumn<FONT 
  face="Courier New">(test,<FONT face="Courier New" 
  color=#ff00ff>"test");<FONT 
  face="Courier New" color=#0000ff>
  AddColumn<FONT 
  face="Courier New">(mo,<FONT face="Courier New" 
  color=#ff00ff>"mo"<FONT 
  size=3>);
  Filter = <FONT 
  size=3>1<FONT face="Courier New" 
  size=1>;<SPAN 
  class=437544714-28112003>
  <SPAN 
  class=437544714-28112003>--------------------------<FONT 
  size=+0>
   
  <IMG 
  src="bmp00011.bmp"><FONT 
  face="Courier New" size=3><SPAN 
  class=437544714-28112003>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


  ADVERTISEMENT 









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.


Attachment: Description: ""