BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Multiple colours on single indicator line
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Multiple colours on single indicator line

 Post Reply Post Reply Page  12>
Author
Message / View First Unread Post
IT-Trader View Drop Down
Regular
Regular


Joined: 10 Nov 2005
Posts: 23
Post Options Post Options   Quote IT-Trader Quote  Post ReplyReply Direct Link To This Post Topic: Multiple colours on single indicator line
    Posted: 24 Mar 2006 at 5:48pm
Take a simple indicator such as CCI(14) and plot it.

I'd like to set it so that when it's above 0 the line is green and when it's below 0 the line is red.

Is this possible?

Thanks,
ITT.

Back to Top
Brendon View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 10 Sep 2004
Location: Australia
Posts: 126
Post Options Post Options   Quote Brendon Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 2006 at 11:46am
Shall do a sample for you.
Back to Top
IT-Trader View Drop Down
Regular
Regular


Joined: 10 Nov 2005
Posts: 23
Post Options Post Options   Quote IT-Trader Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 2006 at 5:14pm
Thanks Brendon, that would really be appreciated.

Along similar lines possibly, I'd like the volume histogram to be blue on days when price closes up and red when price closes down.
(...and maybe variations like C versus O,  or today's H vs yest. H,  but they are wish list rather than having an immediate use).

My mind is a little addled today so I can't seem to work it out.

Many thanks for your continued support,
ITT.



Edited by IT-Trader
Back to Top
Brendon View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 10 Sep 2004
Location: Australia
Posts: 126
Post Options Post Options   Quote Brendon Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 2006 at 4:55pm

This is the closest we can can up with - needs to be  Bar style to make it easier to read.

[horzline=0]

n := input("Time periods",14,1);

[color=rgb(000,000,255);name=up; Linestyle=Bar]

if(cci(n)>=0,cci(n),0);

[color=rgb(255,000,000);name=down; Linestyle=Bar]

if(cci(n)<=0,cci(n),0);

 

 

Back to Top
IT-Trader View Drop Down
Regular
Regular


Joined: 10 Nov 2005
Posts: 23
Post Options Post Options   Quote IT-Trader Quote  Post ReplyReply Direct Link To This Post Posted: 30 Mar 2006 at 11:14am
Hi Brendon,

That works exactly as hoped for the second question about volume and I think I can work a variant to make line indicators (like cci) suit the purpose I had in mind.

Many thanks for the help again.

ITT.

btw, for anyone else the volume version looked like this....

[color=rgb(000,000,255);name=up; Linestyle=bar]
if(C>O,V,0);

[color=rgb(255,000,000);name=down; Linestyle=bar]
if(C<O,V,0);

I find it useful to distinguish between the volume on up-days vs down-days.

Back to Top
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Posted: 08 Apr 2006 at 12:46pm
IT-Trader, you can also try the Fill attribute. e.g.

[linestyle=fill; color=green; transparency=50]
cci(14);
[color=red; transparency=50]
0

For the 2nd Q, I simply right click and change the color property of the volume panel to colour the volumes. I'm not sure if that's what you are after.
Back to Top
IT-Trader View Drop Down
Regular
Regular


Joined: 10 Nov 2005
Posts: 23
Post Options Post Options   Quote IT-Trader Quote  Post ReplyReply Direct Link To This Post Posted: 18 Apr 2006 at 10:37am
Owen,

The fill style is simply filling the the gap below/above the indicator, it was actually getting the indicator line itself to be green above a predertimed number and red below it.

From Brendon's comments, it sounds like this isn't possible.  It's far from being a big deal, I asked in case I'd missed something.
(The CCI was only used as an example to keep it simple.)

On the volume colour question, you have indeed misunderstood.  Your suggestion would change all the volume days to be a single colour.

The code I posted shows the volume in blue on days when the C is
above the O, and in red on days when the C is below the O.

However, there is one circumstance I forgot to cover, those when O=C, I've since added and extra line to plot volume in balck on those days.

It may not appear overly helpful but it speeds up part of my selection process.

ITT.
Back to Top
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Posted: 18 Apr 2006 at 11:21am
IT-Trader, is this what you need?


Back to Top
IT-Trader View Drop Down
Regular
Regular


Joined: 10 Nov 2005
Posts: 23
Post Options Post Options   Quote IT-Trader Quote  Post ReplyReply Direct Link To This Post Posted: 18 Apr 2006 at 11:44am
LOL - yeah that's it.

You realise, of course, that all this is moot!

Thanks anyway.
ITT.
(btw, do you think you could have made the chart a bit bigger!)

Back to Top
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Posted: 18 Apr 2006 at 12:44pm
ITT,

See how I coloured the volume bars by changing the volume plot properties. I did not do any coding.

You want the chart even bigger? You are kidding right?
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz