Thanks, Graham. Seems a bit strange to need
EncodeColor() when the color variable is specified in Plot(). Is this the
way previous versions worked?
In any case, when I put your fix into a slightly
different formula instead of getting only the two colors specified in IIF()
a whole range of colors appears, depending on the selected bar. Below are
two screen shots showing two different unspecified colors for the "MA
Difference" name for two different bars. The plot of maDiff (red and
bright green dots) displays the right colors. However, the color of the
name changes through about 8 different colors depending on the bar
selected. The screen shots below show the result for two different
bars. Also, note that a number (color number?) appears in front of
the name for some colors but not others (aqua has number but not
red). I have never seen a color number displayed before.
The code below is based on the previous one and produces this
effect.
Any idea what is going on and how to get around
this? It seems to me unless there is a setting that affects this
behavior, this might be one for support.
---------------------------------------------
maDiff = MA(C,
50) - MA(C, 200);
colorMaDiff = IIf(maDiff <= 0,
colorRed, colorBrightGreen);
Plot (maDiff, EncodeColor(SelectedValue(maDiff)) + " MA Difference",
colorMaDiff, styleOwnScale|styleDots);
Plot ( C, "", colorWhite,
styleBar);
------------------------------------------------
----- Original Message -----
Sent: Saturday, November 05, 2005 8:41
PM
Subject: Re: [amibroker] Plot()
question
this will change the name of the plot in title, but not the value
Plot (diffMa, EncodeColor(SelectedValue(colorDiffMa))+"diffMa", colorDiffMa, styleLine);
On 11/6/05, wavemechanic <fimdot@xxxxxxxxx> wrote:
I am using version 4.74.6 and have run across
something that I have not seen before and that I assume is not a
bug.
Using the simple code below, the plot correctly
displays the right color depending on the value of the variable
diffMa. However, the name in Plot() is a constant color (lime) instead
of the color of the plot which is defined in IIF(). (see attached
screen shot). If IIF() is replaced by a color ( e.g, colorRed), the
name correctly assumes this color. The problem occurs only when IIF()
is used. Lime is the up color for candlesticks, but changing this
color does not change the color of name on the chart.
Are there new settings for controlling the color
of name? Any ideas?
Bill
----------------------------
MA1 = MA(C, 200);
MA2 = MA(C, 50);
diffMa = MA1 - MA2;
colorDiffMa = IIf(diffMa <= 0, colorRed, colorWhite);
Plot (diffMa, "diffMa", colorDiffMa, styleLine);
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
YAHOO! GROUPS LINKS
|