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

RE: [amibroker] AFL question



PureBytes Links

Trading Reference Links




<SPAN 
class=973562404-28102003>IIF returns one of two values, depending on a 
condition, like this:
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>  result = IIF(condition, true_value, 
false_value);
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>you're missing the second two parameters. put your 
cursor somewhere inside the word 'IIF' in the AFL editor, and press F1. you'll 
get help on that function.
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>you'd want something like this:
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>
<SPAN 
class=973562404-28102003>  Larger = IIF(Close > Open, 1, 
0);
<SPAN 
class=973562404-28102003>  Smaller = IIF(Close < Open, 1, 
0);
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>a simpler answer doesn't even need 
IIF:
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>  Larger = Close > Open;
<SPAN 
class=973562404-28102003>  Smaller = Close < Open;
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>those both return arrays, with true where the condition 
is true.
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>hth,
<SPAN 
class=973562404-28102003> 
<SPAN 
class=973562404-28102003>dave
<SPAN 
class=973562404-28102003> 
<BLOCKQUOTE 
>I 
  am trying to create a scan that compares the Close to the Open- and puts 
  the lower value in A1 and the higher value in B1Larger =IIF(Close > 
  Open); Smaller =IIF(Close < 
  Open);A1=Smaller;B1=Larger;This formula gives me an error- 
  Can someone help me fix this 
formula.Thanks,Brian






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.