highlight all daily volume bars over 10 million shares of volume


Category:
0
0

Hello Hahn,

 

I wanted to now how to create a chart study that highlights the volume bars in the daily chart that are over 10 million shares of volume.

If volume > 10 million then highlight bar yellow

Marked as spam
Posted by (Questions: 22, Answers: 63)
Asked on November 9, 2018 9:06 am
113 views
0
Private answer

Do you really want to “know how to create” this….? Or are you just asking me to create it?

If you are asking how, I can give you some guidance and you can try to work this out on your own.

You already have the condition worked out, so you should be able to write that statement without any problem.

The way we change the color of the candle is by using “AssignPriceColor()”. (There are several examples scattered throughout the forum)

It basically looks like this:

AssignPriceColor(if condition then Color.YELLOW else Color.CURRENT);

There you go. I have shown you how to create it. You should be able to do this in two statements, one if your good.

Update 11/9/18
After comments from the author of this post I realized I did not understand the request clearly

Sorry about that. I missed the part that you are asking to color the volume bars. I thought you wanted to color the bars on the chart. So here is a full lower study that plots volume bars (which must be done before we can color them).

plot volumeData = volume;
volumeData.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
volumeData.SetLineWeight(3);
volumeData.AssignValueColor(if volumeData > volumeData[1] then Color.GREEN else if volumeData > 100000000 then Color.YELLOW else Color.RED);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 9, 2018 10:42 am
0

I am getting an error. I am using this on the dialey chart volume section.

AssignPriceColor(if volume > 100000000 then Color.YELLOW else Color.CURRENT)

( at November 9, 2018 10:50 am)
0

Every statement of code must end with a semicolon “;”

( at November 9, 2018 11:09 am)
0

Sorry I missed that, the code however changes the price bars and not the volume bars?

I think the statement “AssignPriceColor” may be wrong. Should it be something like AssignVolumeBarColor ?????

( at November 9, 2018 11:15 am)
0

I have updated my answer to include the solution you were actually seaking. Sorry about that, thought you only wanted to color chart bars.

( at November 9, 2018 12:35 pm)