PureBytes Links
Trading Reference Links
|
<SPAN
class=575192905-25082003>Harvey,
As you
surmised the problem is with your IIf statement. In the title line try using
Writeif instead......
<SPAN
class=575192905-25082003>
<FONT
color=#282828>
ChPct = ROC(C<FONT
face=Arial>,1);
ChCol =
ChPct>=Ref<FONT
color=#282828>(ChPct,-1<FONT
color=#282828>);<FONT
color=#0000ff>
Title = WriteIf(chcol,EncodeColor(colorGreen)+ "Rate of change is
Rising "+ WriteVal(ChPct,1.2), EncodeColor(colorRed)+"Rate of Change is Falling
"+WriteVal(Chpct,1.2));
<SPAN
class=575192905-25082003>to eliminate the text just
use.....
<SPAN
class=575192905-25082003>
<SPAN
class=575192905-25082003>
ChPct = ROC(<FONT
size=2>C,1<FONT
size=2>);
ChCol = ChPct>=<FONT color=#0000ff
size=2>Ref(ChPct,-<FONT color=#ff00ff
size=2>1);<FONT color=#000000
size=2>
Title = <FONT face=Arial
size=2>WriteIf(chcol,<FONT face=Arial
size=2>EncodeColor(<FONT face=Arial
size=2>colorGreen)+ <FONT face=Arial
size=2>" "+ <FONT
size=2>WriteVal(ChPct,1.2<FONT
size=2>), <FONT face=Arial
size=2>EncodeColor(<FONT face=Arial
size=2>colorRed)+"
"+<FONT face=Arial
size=2>WriteVal(Chpct,<FONT face=Arial
size=2>1.2));<FONT color=#ff00ff
face=Arial size=2>
Regards,
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: harvey_1929
[mailto:Hhp@xxxxxxx]Sent: Monday, August 25, 2003 12:26
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] IIf
functionWould someone please explain to me why the
following code fragment does not work. It is part of an IB formula for
a price display.ChPct = ROC(C,1);ChCol =
IIf(ChPct>=Ref(ChPct,-1), colorGreen, colorRed);Title =
EncodeColor(ChCol) + WriteVal(ChPct,1.2);When I try to apply it I get
the response "Bad args. 0-th argument of function call has invalid (or
unsupported) type", and also "Error 1. Operation not allowed".The
problem is the condition in the IIf function. I can replace line 2
with "ChCol = colorGreen" and it works. I can substitute a 1 or a 0
for the condition and get the color switches. The condition I have set
up must evaluate to True (1) or False (0). What am I not seeing?
Thanks for any enlightenment.HHP================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.
|