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

[amibroker] Colored Bars?



PureBytes Links

Trading Reference Links




I have to be missing something simple here but 
would appreciate your help.
 
I want to simply plot a green bar if the close 
crosses from below the LinReg line to above and plot a red bar if the close 
falls below the line from above.
 
I use:
Y=C; //Data 
arrayT1=14;LR=LinearReg(Y,T1);
 
BC=<FONT 
color=#ff0000>IIf(Ref(Y,-1) < LR AND Y > LR ,colorGreen , IIf(Ref(Y,-1) 
> LR AND Y < LR ,colorRed,colorBlue));
 
<FONT face=Tahoma color=#0000ff 
size=2>GraphXSpace=2;Plot(Y,"Prices",BC,128);Plot(LR,"LinReg 
Line",colorLightBlue,1);
However, I get lots of green bars together, when 
it is obvious (to me) that the second and third green bar violates the rule for 
color selection.
 
<IMG alt="" hspace=0 
src="png00159.png" align=baseline 
border=0>
 
It is interesting that <FONT 
color=#0000ff>BC=IIf(Cross(Y,LR) ,colorGreen , IIf(Cross(LR,Y) 
,colorRed,colorBlue)); works but the first example of 
BC doesn't.
Makes me leery of decisions made by 
AB.
Any ideas why?
 
Thanks,
-CS






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: ""