volume histogram color

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Guest

volume histogram color

Postby Guest » 28 Feb 2007

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!

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 28 Feb 2007

Here is the code:

Code: Select all

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

Guest

Postby Guest » 01 Mar 2007

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!

Guest

Postby Guest » 01 Mar 2007

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 );

Guest

Postby Guest » 03 Mar 2007

I'm actually trying it with a 5 minute chart. The color of the volume histogram remains unchanged.

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 03 Mar 2007

Set the indicator to update on every tick and not at the close of the bar.


Return to “User Contributed Studies and Indicator Library”