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

Re: [amibroker] Simple Plot() question



PureBytes Links

Trading Reference Links

I did a quick check on a chart and this works for me

Cond1 = Day()<=10;
Cond2 = Day()>=20;
mycolor = IIf(Cond1,colorGreen,IIf(Cond2,colorRed,colorBlue));

Plot( MA(C,10), "ma", mycolor, styleLine );

the alternative of adding will give you different colours as they are
represented as numbers

IIf(Cond1,colorGreen,colorBlue) + IIf(Cond2,colorRed,colorBlue);

Cond1 = green + blue = 27+29 = 56 = ?? only got between 0 and 55 colour slots
Cond 2 = blue + red = 29 + 32 = 61 = ??
else = blue + blue = 29 + 29 = 58
a you can see they are all outside the colour number range so possibly
no colour results, therefor no line

getting something back into colour range, if you had brown(17) and
black(16) you would have resulting colour lime(33)

--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 11/28/05, WALTON, Nathan <nathan.walton@xxxxxxxxxxxxxx> wrote:
> I'd use the first method but substitute "colorRed" for "coloRed". If
> that's not it, check that Cond1 is giving you the values you expect.
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf Of owenbdavies
> Sent: Monday, 28 November 2005 12:18 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Simple Plot() question
>
> I'd like to use different colors for each of three possible
> conditions. The obvious ways (at least to me) are:
>
> IIf(Cond1,colorGreen,IIf(Cond2,coloRed,colorBlue)); Or
>
> IIf(Cond1,colorGreen,colorBlue) + IIf(Cond2,colorRed,colorBlue);
>
> Unfortunately, with the first method, only the second IIf statement
> counts; the parts of the line that should be green end up blue. And
> with the second method, nothing shows up at all; the tooltips give the
> appropriate value, but no line appears.
>
> Can anyone tell me how to make this work?
>
> Many thanks.
>
> Owen


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/