Page 1 of 1

volume histogram color

Posted: 28 Feb 2007
by Guest
Hi folks

I have no programming experience and I was wondering if there are any Easylanguage experts that can lend a hand in writing a few lines of code.

I can sum up the logic in plain English fairly succinctly but have no idea how to code this.

Here's the logic: I want the bars of the volume histogram to be black when price closes above open. And I want the bars of the volume histogram to be red when price closes below open. That's it.

It sounds simple enough and is actually bog standard on many charting packages.

Any help is appreciated.

Cheers!

Posted: 28 Feb 2007
by Stanley Miller
Here is the code:

Code: Select all

if close > open then
Plot1( Volume, "Volume", black )
else
Plot1( Volume, "Volume", red );

Posted: 01 Mar 2007
by Guest
Stanley

Thanks for posting the code.

The code successfully compiled and I applied it over the standard Volume indicator but did not see a change in the colors of the volume histogram. I also tried the study in a separate window but nothing showed up.

I am using a 5min chart and have selected Same as Symbol under format scaling. However I still don't get different colors on Volume histogram.

Any ideas what could be wrong?

Cheers!

Posted: 01 Mar 2007
by Guest
I assume you were refering to current day's open.
Then the code is

if close > openD(0) then
Plot1( Volume, "Volume", black )
else
Plot1( Volume, "Volume", red );

Posted: 03 Mar 2007
by Guest
I'm actually trying it with a 5 minute chart. The color of the volume histogram remains unchanged.

Posted: 03 Mar 2007
by Stanley Miller
Set the indicator to update on every tick and not at the close of the bar.